Skip to content

Commit

Permalink
it's cover? (with a ?)
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jan 12, 2012
1 parent 19c64a5 commit 95bf234
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rspec/matchers.rb
Expand Up @@ -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>.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/matchers/built_in.rb
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 95bf234

Please sign in to comment.