test/unit/assertions/assert_match_tests.rb in assert-2.18.3 vs test/unit/assertions/assert_match_tests.rb in assert-2.18.4
- old
+ new
@@ -6,23 +6,22 @@
module Assert::Assertions
class AssertMatchTests < Assert::Context
include Assert::Test::TestHelpers
desc "`assert_match`"
- subject { test1 }
-
- let(:desc1) { "assert match fail desc" }
- let(:args1) { ["not", "a string", desc1] }
- let(:test1) {
+ subject {
args = args1
Factory.test do
assert_match(/a/, "a string") # pass
assert_match(*args) # fail
end
}
- let(:config1) { test1.config }
+ let(:desc1) { "assert match fail desc" }
+ let(:args1) { ["not", "a string", desc1] }
+ let(:config1) { subject.config }
+
should "produce results as expected" do
subject.run(&test_run_callback)
assert_that(test_run_result_count).equals(2)
assert_that(test_run_result_count(:pass)).equals(1)
@@ -37,21 +36,20 @@
class AssertNotMatchTests < Assert::Context
include Assert::Test::TestHelpers
desc "`assert_not_match`"
- subject { test1 }
-
- let(:desc1) { "assert not match fail desc" }
- let(:args1) { [/a/, "a string", desc1] }
- let(:test1) {
+ subject {
args = args1
Factory.test do
assert_not_match(*args) # fail
assert_not_match("not", "a string") # pass
end
}
- let(:config1) { test1.config }
+
+ let(:desc1) { "assert not match fail desc" }
+ let(:args1) { [/a/, "a string", desc1] }
+ let(:config1) { subject.config }
should "produce results as expected" do
subject.run(&test_run_callback)
assert_that(test_run_result_count).equals(2)