diff options
Diffstat (limited to 'spec/ruby/core/enumerable/one_spec.rb')
-rw-r--r-- | spec/ruby/core/enumerable/one_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/ruby/core/enumerable/one_spec.rb b/spec/ruby/core/enumerable/one_spec.rb index 47bfd65a0f..4bf8623d2e 100644 --- a/spec/ruby/core/enumerable/one_spec.rb +++ b/spec/ruby/core/enumerable/one_spec.rb @@ -83,7 +83,6 @@ describe "Enumerable#one?" do end end - describe 'when given a pattern argument' do it "calls `===` on the pattern the return value " do pattern = EnumerableSpecs::Pattern.new { |x| x == 1 } @@ -145,5 +144,11 @@ describe "Enumerable#one?" do multi.one?(pattern).should == false pattern.yielded.should == [[[1, 2]], [[3, 4, 5]], [[6, 7, 8, 9]]] end + + it "ignores the block if there is an argument" do + -> { + EnumerableSpecs::Numerous.new(1, 2, 3, 4, "5").one?(String) { false }.should == true + }.should complain(/given block not used/) + end end end |