Fixes problem with RSpec matcher. Probably the RSpec API changed recently.
Changes are based on the documentation provided here: http://rubydoc.info/gems/rspec-expectations/RSpec/Matchers
This commit is contained in:
parent
1ed54b1d59
commit
8fb7ccd089
|
@ -1,9 +1,7 @@
|
||||||
module Capybara
|
module Capybara
|
||||||
module Webkit
|
module Webkit
|
||||||
module RspecMatchers
|
module RspecMatchers
|
||||||
extend RSpec::Matchers::DSL
|
RSpec::Matchers.define :have_errors do |expected|
|
||||||
|
|
||||||
matcher :have_errors do |expected|
|
|
||||||
match do |actual|
|
match do |actual|
|
||||||
actual = resolve(actual)
|
actual = resolve(actual)
|
||||||
actual.error_messages.any?
|
actual.error_messages.any?
|
||||||
|
@ -12,6 +10,7 @@ module Capybara
|
||||||
failure_message_for_should do |actual|
|
failure_message_for_should do |actual|
|
||||||
"Expected Javascript errors, but there were none."
|
"Expected Javascript errors, but there were none."
|
||||||
end
|
end
|
||||||
|
|
||||||
failure_message_for_should_not do |actual|
|
failure_message_for_should_not do |actual|
|
||||||
actual = resolve(actual)
|
actual = resolve(actual)
|
||||||
"Expected no Javascript errors, got:\n#{error_messages_for(actual)}"
|
"Expected no Javascript errors, got:\n#{error_messages_for(actual)}"
|
||||||
|
@ -33,7 +32,6 @@ module Capybara
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue