Skip to content

Commit

Permalink
Fixes problem with RSpec matcher. Probably the RSpec API changed rece…
Browse files Browse the repository at this point in the history
…ntly.


Changes are based on the documentation provided here:
http://rubydoc.info/gems/rspec-expectations/RSpec/Matchers
  • Loading branch information
chrisnicola authored and jferris committed Mar 23, 2012
1 parent 1ed54b1 commit 8fb7ccd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/capybara/webkit/matchers.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module Capybara
module Webkit
module RspecMatchers
extend RSpec::Matchers::DSL

matcher :have_errors do |expected|
RSpec::Matchers.define :have_errors do |expected|
match do |actual|
actual = resolve(actual)
actual.error_messages.any?
Expand All @@ -12,6 +10,7 @@ module RspecMatchers
failure_message_for_should do |actual|
"Expected Javascript errors, but there were none."
end

failure_message_for_should_not do |actual|
actual = resolve(actual)
"Expected no Javascript errors, got:\n#{error_messages_for(actual)}"
Expand All @@ -33,7 +32,6 @@ def resolve(actual)
end
end
end

end
end
end

0 comments on commit 8fb7ccd

Please sign in to comment.