test/unit/test_tests.rb in assert-2.18.4 vs test/unit/test_tests.rb in assert-2.19.0
- old
+ new
@@ -15,11 +15,11 @@
let(:context_class1) { Factory.modes_off_context_class { desc "context class" } }
let(:context_info1) { Factory.context_info(context_class1) }
let(:config1) { Factory.modes_off_config }
let(:test_code1) { proc { assert(true) } }
- should have_imeths :name_file_line_context_data, :for_block, :for_method
+ should have_imeths :name_file_line_context_data, :for_block
should "know how to build the name and file line given context" do
test_name = Factory.string
data = subject.name_file_line_context_data(context_info1, test_name)
@@ -42,32 +42,10 @@
assert_that(test.context_info).equals(context_info1)
assert_that(test.config).equals(config1)
assert_that(test.code).equals(test_code1)
end
-
- should "build tests for a method" do
- meth = "a_test_method"
- test = subject.for_method(meth, context_info1, config1)
-
- exp = Assert::FileLine.parse(context_info1.called_from)
- assert_that(test.file_line).equals(exp)
-
- exp = context_info1.test_name(meth)
- assert_that(test.name).equals(exp)
-
- assert_that(test.context_info).equals(context_info1)
- assert_that(test.config).equals(config1)
-
- assert_that(test.code).is_kind_of(Proc)
- self.instance_eval(&test.code)
- assert_that(@a_test_method_called).is_true
- end
-
- def a_test_method
- @a_test_method_called = true
- end
end
class InitWithDataTests < UnitTests
desc "when init with data"
subject { unit_class.new(meta_data1.merge(run_data1)) }
@@ -313,24 +291,24 @@
should "raise any signal exceptions and not capture as an error" do
test = Factory.test("signal test", context_info1) do
raise SignalException, "USR1"
end
- assert_that(-> { test.run }).raises(SignalException)
+ assert_that { test.run }.raises(SignalException)
end
should "raises signal exceptions in the context setup" do
test = Factory.test("setup signal test", context_info1){ }
test.context_class.setup{ raise SignalException, "INT" }
- assert_that(-> { test.run }).raises(SignalException)
+ assert_that { test.run }.raises(SignalException)
end
should "raises signal exceptions in the context teardown" do
test = Factory.test("teardown signal test", context_info1){ }
test.context_class.teardown{ raise SignalException, "TERM" }
- assert_that(-> { test.run }).raises(SignalException)
+ assert_that { test.run }.raises(SignalException)
end
end
class ComparingTests < UnitTests
desc "<=> another test"