You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
"it" as default default parameter block for Ruby #2645
A recent discussion was open on Ruby tracker for a proposal about a default block parameter. Even if the idea is good, the proposal is to have a default block parameter named it.
--- a/spec/rspec/core/example_group_spec.rb+++ b/spec/rspec/core/example_group_spec.rb@@ -33,6 +33,10 @@ module RSpec::Core
end
end
+ it "does not blow up with 'it' patch" do+ expect([1, 2].map { it.to_s }).to eq(["1", "2"])+ end+
~/code/ruby_source_code/install/bin/bundle exec rspec spec/rspec/core/example_group_spec.rb --example patch [15:57:56]
Run options: include {:full_description=>/patch/}
Randomized with seed 61921
RSpec::Core::ExampleGroup
does not blow with 'it' patch
Finished in 0.00315 seconds (files took 0.28764 seconds to load)
1 example, 0 failures
Randomized with seed 61921
=end
It works. Same with all of the rspec-core test suite.
Curious about what do you think about this Ruby proposal @JonRowe.
Activity
benoittgt commentedon Jul 2, 2019
I open the issue only to have a discussion.
benoittgt commentedon Jul 2, 2019
I wrote a test in RSpec core test suite and run using ruby master with an updated patch.
~/code/ruby_source_code/install/bin/bundle exec rspec spec/rspec/core_spec.rbIt works. Same with all of the rspec-core test suite.
Curious about what do you think about this Ruby proposal @JonRowe.
[-]Ruby proposal for default bloc parameter with "it"[/-][+]"it" as default default parameter block for Ruby[/+]JonRowe commentedon Jul 3, 2019
Thanks for the heads up, I've left some feedback