capybara_minitest_spec 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +5 -0
- data/lib/capybara_minitest_spec/version.rb +1 -1
- data/lib/capybara_minitest_spec.rb +3 -2
- data/test/spec_helper.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'minitest/spec'
|
1
2
|
require "capybara_minitest_spec/version"
|
2
3
|
|
3
4
|
# Define assertions for each Capybara node matcher.
|
@@ -12,7 +13,7 @@ module MiniTest::Expectations
|
|
12
13
|
# Define positive assertion.
|
13
14
|
positive_assertion_name = :"assert_page_#{without_question_mark}"
|
14
15
|
define_method positive_assertion_name do |page, *args|
|
15
|
-
assert wrap(page).send(matcher_name, *args), "Matcher #{without_question_mark}
|
16
|
+
assert wrap(page).send(matcher_name, *args), "Matcher failed: #{without_question_mark}"
|
16
17
|
end
|
17
18
|
|
18
19
|
# Infect positive assertion.
|
@@ -22,7 +23,7 @@ module MiniTest::Expectations
|
|
22
23
|
# Define negative assertion.
|
23
24
|
negative_assertion_name = :"refute_page_#{without_question_mark}"
|
24
25
|
define_method negative_assertion_name do |page, *args|
|
25
|
-
refute wrap(page).send(matcher_name, *args), "Matcher
|
26
|
+
refute wrap(page).send(matcher_name, *args), "Matcher should have failed: #{without_question_mark}"
|
26
27
|
end
|
27
28
|
|
28
29
|
# Infect negative assertions.
|
data/test/spec_helper.rb
CHANGED
@@ -23,6 +23,6 @@ class Proc
|
|
23
23
|
include MiniTest::Assertions
|
24
24
|
# TODO: Replace this with a real assertion that checks the message.
|
25
25
|
def must_raise(exception_or_message)
|
26
|
-
assert_raises(MiniTest::Assertion, &self)
|
26
|
+
exception = assert_raises(MiniTest::Assertion, &self)
|
27
27
|
end
|
28
28
|
end
|