Skip to content
Browse files

it's cover? (with a ?)

  • Loading branch information...
1 parent 19c64a5 commit 95bf234242c9abd0d9021998e693260abf1fd4c0 @dchelimsky dchelimsky committed Jan 11, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/rspec/matchers.rb
  2. +1 −1 lib/rspec/matchers/built_in.rb
  3. +1 −1 spec/rspec/matchers/cover_spec.rb
View
2 lib/rspec/matchers.rb
@@ -353,7 +353,7 @@ def change(receiver=nil, message=nil, &block)
# ### Warning:: Ruby >= 1.9 only
def cover(*values)
BuiltIn::Cover.new(*values)
- end if (1..2).respond_to?(:cover)
+ end if (1..2).respond_to?(:cover?)
# Passes if <tt>actual == expected</tt>.
#
View
2 lib/rspec/matchers/built_in.rb
@@ -12,7 +12,7 @@ module BuiltIn
autoload :BeAKindOf, 'rspec/matchers/built_in/be_kind_of'
autoload :BeWithin, 'rspec/matchers/built_in/be_within'
autoload :Change, 'rspec/matchers/built_in/change'
- autoload :Cover, 'rspec/matchers/built_in/cover' if defined?("[].cover?")
+ autoload :Cover, 'rspec/matchers/built_in/cover' if (1..2).respond_to?(:cover?)
autoload :Eq, 'rspec/matchers/built_in/eq'
autoload :Eql, 'rspec/matchers/built_in/eql'
autoload :Equal, 'rspec/matchers/built_in/equal'
View
2 spec/rspec/matchers/cover_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-if (1..2).respond_to?(:cover)
+if (1..2).respond_to?(:cover?)
describe "should cover(expected)" do
context "for a range target" do
it "passes if target covers expected" do

0 comments on commit 95bf234

Please sign in to comment.
Something went wrong with that request. Please try again.