Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion - Nested initialization #23

Open
AlexB52 opened this issue Jan 28, 2023 · 0 comments
Open

Conversion - Nested initialization #23

AlexB52 opened this issue Jan 28, 2023 · 0 comments

Comments

@AlexB52
Copy link
Owner

AlexB52 commented Jan 28, 2023

Currently Rubocop doesn't parse nested array appropriately.
Here are examples after the setup conversion.

They seem off and probable makes some ruby-specs fail resulting in skipping some of them.

# nested arrays
ary = [Grizzly::Collection[1, 2, 3]]
Grizzly::Collection[].flatten.should be_an_instance_of(Grizzly::Collection)
Grizzly::Collection[1, 2, 3].flatten.should be_an_instance_of(Grizzly::Collection)
Grizzly::Collection[1, [2], 3].flatten.should be_an_instance_of(Grizzly::Collection)
Grizzly::Collection[1, [2, 3], 4].flatten.should == [1, 2, 3, 4]
[Grizzly::Collection[1, 2, 3]].flatten.should be_an_instance_of(Grizzly::Collection)

# arrays with variables
[1, z, 6].flatten!.should == [1, 2, 3, 4, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant