Skip to content

Commit

Permalink
eliminate warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 30, 2011
1 parent f852ee1 commit 4ef2397
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions lib/rspec/matchers/include.rb
Expand Up @@ -22,14 +22,14 @@ def description

private

def perform_match(predicate, hash_predicate, actual, expected)
expected.send(predicate) do |expected|
if comparing_hash_values?(actual, expected)
expected.send(hash_predicate) {|k,v| actual[k] == v}
elsif comparing_hash_keys?(actual, expected)
actual.has_key?(expected)
def perform_match(predicate, hash_predicate, actuals, expecteds)
expecteds.send(predicate) do |expected|
if comparing_hash_values?(actuals, expected)
expected.send(hash_predicate) {|k,v| actuals[k] == v}
elsif comparing_hash_keys?(actuals, expected)
actuals.has_key?(expected)
else
actual.include?(expected)
actuals.include?(expected)
end
end
end
Expand Down
3 changes: 1 addition & 2 deletions lib/rspec/matchers/pretty.rb
Expand Up @@ -39,7 +39,7 @@ def name_to_sentence
end

def expected_to_sentence
to_sentence(@expected)
to_sentence(@expected) if defined?(@expected)
end

def name
Expand All @@ -55,7 +55,6 @@ def underscore(camel_cased_word)
word.downcase!
word
end

end
end
end
2 changes: 1 addition & 1 deletion spec/rspec/matchers/change_spec.rb
Expand Up @@ -113,7 +113,7 @@ def <<(element)
end

def dup
self.class.new *elements
self.class.new(*elements)
end

def ==(other)
Expand Down

0 comments on commit 4ef2397

Please sign in to comment.