assert 2.18.0 → 2.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +66 -37
  3. data/assert.gemspec +4 -3
  4. data/lib/assert/actual_value.rb +140 -0
  5. data/lib/assert/assertions.rb +80 -20
  6. data/lib/assert/context.rb +31 -37
  7. data/lib/assert/context/let_dsl.rb +13 -0
  8. data/lib/assert/context/method_missing.rb +19 -0
  9. data/lib/assert/context/subject_dsl.rb +23 -24
  10. data/lib/assert/macros/methods.rb +4 -4
  11. data/lib/assert/result.rb +5 -1
  12. data/lib/assert/stub.rb +16 -0
  13. data/lib/assert/suite.rb +7 -10
  14. data/lib/assert/test.rb +0 -8
  15. data/lib/assert/version.rb +1 -1
  16. data/test/helper.rb +23 -25
  17. data/test/support/factory.rb +15 -0
  18. data/test/system/stub_tests.rb +332 -333
  19. data/test/system/test_tests.rb +99 -109
  20. data/test/unit/actual_value_tests.rb +371 -0
  21. data/test/unit/assert_tests.rb +111 -43
  22. data/test/unit/assertions/assert_block_tests.rb +30 -31
  23. data/test/unit/assertions/assert_changes_tests.rb +97 -0
  24. data/test/unit/assertions/assert_empty_tests.rb +33 -32
  25. data/test/unit/assertions/assert_equal_tests.rb +94 -74
  26. data/test/unit/assertions/assert_file_exists_tests.rb +32 -33
  27. data/test/unit/assertions/assert_includes_tests.rb +38 -37
  28. data/test/unit/assertions/assert_instance_of_tests.rb +34 -33
  29. data/test/unit/assertions/assert_kind_of_tests.rb +34 -33
  30. data/test/unit/assertions/assert_match_tests.rb +34 -33
  31. data/test/unit/assertions/assert_nil_tests.rb +30 -31
  32. data/test/unit/assertions/assert_raises_tests.rb +55 -55
  33. data/test/unit/assertions/assert_respond_to_tests.rb +36 -35
  34. data/test/unit/assertions/assert_same_tests.rb +86 -81
  35. data/test/unit/assertions/assert_true_false_tests.rb +60 -60
  36. data/test/unit/assertions_tests.rb +26 -24
  37. data/test/unit/config_helpers_tests.rb +43 -38
  38. data/test/unit/config_tests.rb +38 -34
  39. data/test/unit/context/let_dsl_tests.rb +10 -0
  40. data/test/unit/context/setup_dsl_tests.rb +70 -81
  41. data/test/unit/context/subject_dsl_tests.rb +15 -43
  42. data/test/unit/context/suite_dsl_tests.rb +15 -16
  43. data/test/unit/context/test_dsl_tests.rb +50 -52
  44. data/test/unit/context_info_tests.rb +23 -15
  45. data/test/unit/context_tests.rb +184 -179
  46. data/test/unit/default_runner_tests.rb +2 -5
  47. data/test/unit/default_suite_tests.rb +57 -53
  48. data/test/unit/factory_tests.rb +5 -3
  49. data/test/unit/file_line_tests.rb +33 -35
  50. data/test/unit/macro_tests.rb +14 -10
  51. data/test/unit/result_tests.rb +159 -183
  52. data/test/unit/runner_tests.rb +64 -64
  53. data/test/unit/suite_tests.rb +56 -59
  54. data/test/unit/test_tests.rb +118 -139
  55. data/test/unit/utils_tests.rb +43 -45
  56. data/test/unit/view_helpers_tests.rb +54 -52
  57. data/test/unit/view_tests.rb +22 -23
  58. metadata +29 -7
@@ -6,19 +6,24 @@ require "assert/config"
6
6
  module Assert::ConfigHelpers
7
7
  class UnitTests < Assert::Context
8
8
  desc "Assert::ConfigHelpers"
9
- setup do
10
- @helpers_class = Class.new do
9
+ subject { unit_class }
10
+
11
+ let(:unit_class) {
12
+ Class.new do
11
13
  include Assert::ConfigHelpers
12
14
 
13
15
  def config
14
16
  # use the assert config since it has tests, contexts, etc
15
- # also maybe use a fresh config that is empty
17
+ # also use a fresh config that is empty
16
18
  @config ||= [Assert.config, Assert::Config.new].sample
17
19
  end
18
20
  end
19
- @helpers = @helpers_class.new
20
- end
21
- subject{ @helpers }
21
+ }
22
+ end
23
+
24
+ class InitTests < UnitTests
25
+ desc "when init"
26
+ subject { unit_class.new }
22
27
 
23
28
  should have_imeths :runner, :suite, :view
24
29
  should have_imeths :runner_seed, :single_test?, :single_test_file_line
@@ -34,67 +39,67 @@ module Assert::ConfigHelpers
34
39
  should have_imeths :ocurring_result_types
35
40
 
36
41
  should "know the config's runner, suite and view" do
37
- assert_equal subject.config.runner, subject.runner
38
- assert_equal subject.config.suite, subject.suite
39
- assert_equal subject.config.view, subject.view
42
+ assert_that(subject.runner).equals(subject.config.runner)
43
+ assert_that(subject.suite).equals(subject.config.suite)
44
+ assert_that(subject.view).equals(subject.config.view)
40
45
  end
41
46
 
42
47
  should "know its runner seed" do
43
- assert_equal subject.config.runner_seed, subject.runner_seed
48
+ assert_that(subject.runner_seed).equals(subject.config.runner_seed)
44
49
  end
45
50
 
46
51
  should "know if it is in single test mode" do
47
- Assert.stub(subject.config, :single_test?){ true }
48
- assert_true subject.single_test?
52
+ Assert.stub(subject.config, :single_test?) { true }
53
+ assert_that(subject.single_test?).is_true
49
54
 
50
- Assert.stub(subject.config, :single_test?){ false }
51
- assert_false subject.single_test?
55
+ Assert.stub(subject.config, :single_test?) { false }
56
+ assert_that(subject.single_test?).is_false
52
57
  end
53
58
 
54
59
  should "know its single test file line" do
55
60
  exp = subject.config.single_test_file_line
56
- assert_equal exp, subject.single_test_file_line
61
+ assert_that(subject.single_test_file_line).equals(exp)
57
62
  end
58
63
 
59
64
  should "know its tests-to-run attrs" do
60
65
  exp = subject.config.suite.tests_to_run?
61
- assert_equal exp, subject.tests_to_run?
66
+ assert_that(subject.tests_to_run?).equals(exp)
62
67
 
63
68
  exp = subject.config.suite.tests_to_run_count
64
- assert_equal exp, subject.tests_to_run_count
69
+ assert_that(subject.tests_to_run_count).equals(exp)
65
70
  end
66
71
 
67
72
  should "know its test/result counts" do
68
73
  exp = subject.config.suite.test_count
69
- assert_equal exp, subject.test_count
74
+ assert_that(subject.test_count).equals(exp)
70
75
 
71
76
  exp = subject.config.suite.result_count
72
- assert_equal exp, subject.result_count
77
+ assert_that(subject.result_count).equals(exp)
73
78
 
74
79
  exp = subject.config.suite.pass_result_count
75
- assert_equal exp, subject.pass_result_count
80
+ assert_that(subject.pass_result_count).equals(exp)
76
81
 
77
82
  exp = subject.config.suite.fail_result_count
78
- assert_equal exp, subject.fail_result_count
83
+ assert_that(subject.fail_result_count).equals(exp)
79
84
 
80
85
  exp = subject.config.suite.error_result_count
81
- assert_equal exp, subject.error_result_count
86
+ assert_that(subject.error_result_count).equals(exp)
82
87
 
83
88
  exp = subject.config.suite.skip_result_count
84
- assert_equal exp, subject.skip_result_count
89
+ assert_that(subject.skip_result_count).equals(exp)
85
90
 
86
91
  exp = subject.config.suite.ignore_result_count
87
- assert_equal exp, subject.ignore_result_count
92
+ assert_that(subject.ignore_result_count).equals(exp)
88
93
  end
89
94
 
90
95
  should "know if all tests are passing or not" do
91
96
  result_count = Factory.integer
92
97
  Assert.stub(subject, :result_count){ result_count }
93
98
  Assert.stub(subject, :pass_result_count){ result_count }
94
- assert_true subject.all_pass?
99
+ assert_that(subject.all_pass?).is_true
95
100
 
96
101
  Assert.stub(subject, :pass_result_count){ Factory.integer }
97
- assert_false subject.all_pass?
102
+ assert_that(subject.all_pass?).is_false
98
103
  end
99
104
 
100
105
  should "know its formatted run time, test rate and result rate" do
@@ -102,39 +107,39 @@ module Assert::ConfigHelpers
102
107
 
103
108
  run_time = Factory.float
104
109
  exp = format % run_time
105
- assert_equal exp, subject.formatted_run_time(run_time, format)
106
- assert_equal exp, subject.formatted_run_time(run_time)
110
+ assert_that(subject.formatted_run_time(run_time, format)).equals(exp)
111
+ assert_that(subject.formatted_run_time(run_time)).equals(exp)
107
112
 
108
113
  test_rate = Factory.float
109
114
  exp = format % test_rate
110
- assert_equal exp, subject.formatted_result_rate(test_rate, format)
111
- assert_equal exp, subject.formatted_result_rate(test_rate)
115
+ assert_that(subject.formatted_result_rate(test_rate, format)).equals(exp)
116
+ assert_that(subject.formatted_result_rate(test_rate)).equals(exp)
112
117
 
113
118
  result_rate = Factory.float
114
119
  exp = format % result_rate
115
- assert_equal exp, subject.formatted_result_rate(result_rate, format)
116
- assert_equal exp, subject.formatted_result_rate(result_rate)
120
+ assert_that(subject.formatted_result_rate(result_rate, format)).equals(exp)
121
+ assert_that(subject.formatted_result_rate(result_rate)).equals(exp)
117
122
  end
118
123
 
119
124
  should "know its formatted suite run time, test rate and result rate" do
120
125
  format = "%.6f"
121
126
 
122
127
  exp = format % subject.config.suite.run_time
123
- assert_equal exp, subject.formatted_suite_run_time(format)
128
+ assert_that(subject.formatted_suite_run_time(format)).equals(exp)
124
129
 
125
130
  exp = format % subject.config.suite.test_rate
126
- assert_equal exp, subject.formatted_suite_test_rate(format)
131
+ assert_that(subject.formatted_suite_test_rate(format)).equals(exp)
127
132
 
128
133
  exp = format % subject.config.suite.result_rate
129
- assert_equal exp, subject.formatted_suite_result_rate(format)
134
+ assert_that(subject.formatted_suite_result_rate(format)).equals(exp)
130
135
  end
131
136
 
132
137
  should "know whether to show test profile info" do
133
- assert_equal !!subject.config.profile, subject.show_test_profile_info?
138
+ assert_that(subject.show_test_profile_info?).equals(!!subject.config.profile)
134
139
  end
135
140
 
136
141
  should "know whether to show verbose info" do
137
- assert_equal !!subject.config.verbose, subject.show_test_verbose_info?
142
+ assert_that(subject.show_test_verbose_info?).equals(!!subject.config.verbose)
138
143
  end
139
144
 
140
145
  should "know what result types occur in a suite's results" do
@@ -145,7 +150,7 @@ module Assert::ConfigHelpers
145
150
  exp = result_types.select do |type_sym|
146
151
  subject.send("#{type_sym}_result_count") > 0
147
152
  end
148
- assert_equal exp, subject.ocurring_result_types
153
+ assert_that(subject.ocurring_result_types).equals(exp)
149
154
  end
150
155
  end
151
156
  end
@@ -10,10 +10,14 @@ require "assert/runner"
10
10
  class Assert::Config
11
11
  class UnitTests < Assert::Context
12
12
  desc "Assert::Config"
13
- setup do
14
- @config = Assert::Config.new
15
- end
16
- subject{ @config }
13
+ subject { unit_class }
14
+
15
+ let(:unit_class) { Assert::Config }
16
+ end
17
+
18
+ class InitTests < UnitTests
19
+ desc "when init"
20
+ subject { unit_class.new }
17
21
 
18
22
  should have_imeths :view, :suite, :runner
19
23
  should have_imeths :test_dir, :test_helper, :test_file_suffixes
@@ -25,73 +29,73 @@ class Assert::Config
25
29
  should have_imeths :single_test_file_line, :single_test_file_path
26
30
 
27
31
  should "default the view, suite, and runner" do
28
- assert_kind_of Assert::DefaultView, subject.view
29
- assert_kind_of Assert::DefaultSuite, subject.suite
30
- assert_kind_of Assert::DefaultRunner, subject.runner
32
+ assert_that(subject.view).is_kind_of(Assert::DefaultView)
33
+ assert_that(subject.suite).is_kind_of(Assert::DefaultSuite)
34
+ assert_that(subject.runner).is_kind_of(Assert::DefaultRunner)
31
35
  end
32
36
 
33
37
  should "default the test dir/helper/suffixes" do
34
- assert_equal "test", subject.test_dir
35
- assert_equal "helper.rb", subject.test_helper
36
- assert_equal ["_tests.rb", "_test.rb"], subject.test_file_suffixes
38
+ assert_that(subject.test_dir).equals("test")
39
+ assert_that(subject.test_helper).equals("helper.rb")
40
+ assert_that(subject.test_file_suffixes).equals(["_tests.rb", "_test.rb"])
37
41
  end
38
42
 
39
43
  should "default the procs" do
40
- assert_not_nil subject.changed_proc
41
- assert_not_nil subject.pp_proc
42
- assert_not_nil subject.use_diff_proc
43
- assert_not_nil subject.run_diff_proc
44
+ assert_that(subject.changed_proc).is_not_nil
45
+ assert_that(subject.pp_proc).is_not_nil
46
+ assert_that(subject.use_diff_proc).is_not_nil
47
+ assert_that(subject.run_diff_proc).is_not_nil
44
48
  end
45
49
 
46
50
  should "default the option settings" do
47
- assert_not_nil subject.runner_seed
48
- assert_not subject.changed_only
49
- assert_empty subject.changed_ref
50
- assert_empty subject.single_test
51
- assert_not subject.pp_objects
52
- assert_not subject.capture_output
53
- assert subject.halt_on_fail
54
- assert_not subject.profile
55
- assert_not subject.verbose
56
- assert_not subject.list
57
- assert_not subject.debug
51
+ assert_that(subject.runner_seed).is_not_nil
52
+ assert_that(subject.changed_only).is_false
53
+ assert_that(subject.changed_ref).is_empty
54
+ assert_that(subject.single_test).is_empty
55
+ assert_that(subject.pp_objects).is_false
56
+ assert_that(subject.capture_output).is_false
57
+ assert_that(subject.halt_on_fail).is_true
58
+ assert_that(subject.profile).is_false
59
+ assert_that(subject.verbose).is_false
60
+ assert_that(subject.list).is_false
61
+ assert_that(subject.debug).is_false
58
62
  end
59
63
 
60
64
  should "apply settings given from a hash" do
61
65
  assert subject.halt_on_fail
62
66
  subject.apply(:halt_on_fail => false)
63
- assert_not subject.halt_on_fail
67
+ assert_that(subject.halt_on_fail).is_false
64
68
 
65
- assert Assert::Config.new.halt_on_fail
66
- assert_not Assert::Config.new(:halt_on_fail => false).halt_on_fail
69
+ assert_that(Assert::Config.new.halt_on_fail).is_true
70
+ assert_that(Assert::Config.new(:halt_on_fail => false).halt_on_fail).is_false
67
71
  end
68
72
 
69
73
  should "know if it is in single test mode" do
70
- assert_false subject.single_test?
74
+ assert_that(subject.single_test?).is_false
71
75
 
72
76
  subject.apply(:single_test => Factory.string)
73
- assert_true subject.single_test?
77
+ assert_that(subject.single_test?).is_true
74
78
  end
75
79
 
76
80
  should "know its single test file line" do
77
81
  exp = Assert::FileLine.parse(File.expand_path("", Dir.pwd))
78
- assert_equal exp, subject.single_test_file_line
82
+ assert_that(subject.single_test_file_line).equals(exp)
79
83
 
80
84
  file_line_path = "#{Factory.path}_tests.rb:#{Factory.integer}"
81
85
  subject.apply(:single_test => file_line_path)
82
86
 
83
87
  exp = Assert::FileLine.parse(File.expand_path(file_line_path, Dir.pwd))
84
- assert_equal exp, subject.single_test_file_line
88
+ assert_that(subject.single_test_file_line).equals(exp)
85
89
  end
86
90
 
87
91
  should "know its single test file path" do
88
92
  exp = Assert::FileLine.parse(File.expand_path("", Dir.pwd)).file
89
- assert_equal exp, subject.single_test_file_path
93
+ assert_that(subject.single_test_file_path).equals(exp)
90
94
 
91
95
  path = "#{Factory.path}_tests.rb"
92
96
  file_line_path = "#{path}:#{Factory.integer}"
93
97
  subject.apply(:single_test => file_line_path)
94
- assert_equal File.expand_path(path, Dir.pwd), subject.single_test_file_path
98
+ assert_that(subject.single_test_file_path).equals(File.expand_path(path, Dir.pwd))
95
99
  end
96
100
  end
97
101
  end
@@ -0,0 +1,10 @@
1
+ require "assert"
2
+ require "assert/context/let_dsl"
3
+
4
+ module Assert::Context::LetDSL
5
+ class UnitTests < Assert::Context
6
+ desc "Assert::Context::LetDSL"
7
+
8
+ # This is tested implicitly by running Assert's test suite.
9
+ end
10
+ end
@@ -4,77 +4,65 @@ require "assert/context/setup_dsl"
4
4
  module Assert::Context::SetupDSL
5
5
  class UnitTests < Assert::Context
6
6
  desc "Assert::Context::SetupDSL"
7
- subject{ @context_class }
7
+ subject { Factory.modes_off_context_class }
8
+
9
+ let(:block1) { ::Proc.new {} }
8
10
  end
9
11
 
10
12
  class SetupTeardownOnceMethodsTests < UnitTests
11
13
  desc "once methods"
12
- setup do
13
- block = @block = ::Proc.new{ something_once = true }
14
- @context_class = Factory.modes_off_context_class do
15
- setup_once(&block)
16
- teardown_once(&block)
17
- end
18
- end
19
14
 
20
15
  should "add the block to the suite" do
21
- assert_includes @block, subject.suite.send(:setups)
22
- assert_includes @block, subject.suite.send(:teardowns)
16
+ subject.setup_once(&block1)
17
+ subject.teardown_once(&block1)
18
+
19
+ assert_that(subject.suite.send(:setups)).includes(block1)
20
+ assert_that(subject.suite.send(:teardowns)).includes(block1)
23
21
  end
24
22
  end
25
23
 
26
24
  class SetupTeardownMethodsTests < UnitTests
27
25
  desc "methods"
28
- setup do
29
- block = @block = ::Proc.new{ something = true }
30
- @context_class = Factory.modes_off_context_class do
31
- setup(&block)
32
- teardown(&block)
33
- end
34
- end
35
26
 
36
27
  should "add the block to the context" do
37
- assert_includes @block, subject.send(:setups)
38
- assert_includes @block, subject.send(:teardowns)
28
+ subject.setup(&block1)
29
+ subject.teardown(&block1)
30
+
31
+ assert_that(subject.send(:setups)).includes(block1)
32
+ assert_that(subject.send(:teardowns)).includes(block1)
39
33
  end
40
34
  end
41
35
 
42
36
  class SetupTeardownWithMethodNameTests < UnitTests
43
37
  desc "methods given a method name"
44
- setup do
45
- method_name = @method_name = :something_amazing
46
- @context_class = Factory.modes_off_context_class do
47
- setup(method_name)
48
- teardown(method_name)
49
- end
50
- end
38
+
39
+ let(:method_name1) { :something_amazing }
51
40
 
52
41
  should "add the method name to the context" do
53
- assert_includes @method_name, subject.send(:setups)
54
- assert_includes @method_name, subject.send(:teardowns)
42
+ subject.setup(method_name1)
43
+ subject.teardown(method_name1)
44
+
45
+ assert_that(subject.send(:setups)).includes(method_name1)
46
+ assert_that(subject.send(:teardowns)).includes(method_name1)
55
47
  end
56
48
  end
57
49
 
58
- class SetupTeardownMultipleTests < UnitTests
50
+ class ParentContextClassTests < UnitTests
51
+ subject { Factory.modes_off_context_class(parent_class1) }
52
+
53
+ let(:parent_class1) { Factory.modes_off_context_class }
54
+ end
55
+
56
+ class SetupTeardownMultipleTests < ParentContextClassTests
59
57
  desc "with multiple calls"
60
- setup do
61
- parent_setup_block = ::Proc.new{ self.setup_status = "the setup" }
62
- parent_teardown_block = ::Proc.new{ self.teardown_status += "the teardown" }
63
- @parent_class = Factory.modes_off_context_class do
64
- setup(&parent_setup_block)
65
- teardown(&parent_teardown_block)
66
- end
67
58
 
68
- context_setup_block = ::Proc.new{ self.setup_status += " has been run" }
69
- context_teardown_block = ::Proc.new{ self.teardown_status += "has been run " }
70
- @context_class = Factory.modes_off_context_class(@parent_class) do
71
- setup(&context_setup_block)
72
- setup(:setup_something)
73
- teardown(:teardown_something)
74
- teardown(&context_teardown_block)
75
- end
59
+ let(:parent_setup_block1) { ::Proc.new { self.setup_status = "the setup" } }
60
+ let(:parent_teardown_block1) { ::Proc.new { self.teardown_status += "the teardown" } }
61
+ let(:context_setup_block1) { ::Proc.new { self.setup_status += " has been run" } }
62
+ let(:context_teardown_block1) { ::Proc.new { self.teardown_status += "has been run " } }
76
63
 
77
- @test_status_class = Class.new do
64
+ let(:test_status_class) {
65
+ Class.new do
78
66
  attr_accessor :setup_status, :teardown_status
79
67
  define_method(:setup_something) do
80
68
  self.setup_status += " with something"
@@ -83,57 +71,58 @@ module Assert::Context::SetupDSL
83
71
  self.teardown_status = "with something "
84
72
  end
85
73
  end
86
- end
74
+ }
75
+
76
+ should "run its parent and its own blocks in the correct order" do
77
+ parent_class1.setup(&parent_setup_block1)
78
+ parent_class1.teardown(&parent_teardown_block1)
79
+ subject.setup(&context_setup_block1)
80
+ subject.setup(:setup_something)
81
+ subject.teardown(:teardown_something)
82
+ subject.teardown(&context_teardown_block1)
87
83
 
88
- should "run it's parent and it's own blocks in the correct order" do
89
- subject.send("run_setups", obj = @test_status_class.new)
90
- assert_equal "the setup has been run with something", obj.setup_status
84
+ subject.send("run_setups", obj = test_status_class.new)
85
+ assert_that(obj.setup_status).equals("the setup has been run with something")
91
86
 
92
- subject.send("run_teardowns", obj = @test_status_class.new)
93
- assert_equal "with something has been run the teardown", obj.teardown_status
87
+ subject.send("run_teardowns", obj = test_status_class.new)
88
+ assert_that(obj.teardown_status).equals("with something has been run the teardown")
94
89
  end
95
90
  end
96
91
 
97
- class AroundMethodTests < UnitTests
92
+ class AroundMethodTests < ParentContextClassTests
98
93
  desc "with multiple `around` calls"
99
- setup do
100
- @parent_class = Factory.modes_off_context_class do
101
- around do |block|
102
- self.out_status ||= ""
103
- self.out_status += "p-around start, "
104
- block.call
105
- self.out_status += "p-around end."
106
- end
107
- end
108
94
 
109
- @context_class = Factory.modes_off_context_class(@parent_class) do
110
- around do |block|
111
- self.out_status += "c-around1 start, "
112
- block.call
113
- self.out_status += "c-around1 end, "
114
- end
115
- around do |block|
116
- self.out_status += "c-around2 start, "
117
- block.call
118
- self.out_status += "c-around2 end, "
119
- end
95
+ let(:test_status_class) { Class.new { attr_accessor :out_status } }
96
+
97
+ should "run its parent and its own blocks in the correct order" do
98
+ parent_class1.around do |block|
99
+ self.out_status ||= ""
100
+ self.out_status += "p-around start, "
101
+ block.call
102
+ self.out_status += "p-around end."
120
103
  end
121
104
 
122
- @test_status_class = Class.new do
123
- attr_accessor :out_status
105
+ subject.around do |block|
106
+ self.out_status += "c-around1 start, "
107
+ block.call
108
+ self.out_status += "c-around1 end, "
109
+ end
110
+ subject.around do |block|
111
+ self.out_status += "c-around2 start, "
112
+ block.call
113
+ self.out_status += "c-around2 end, "
124
114
  end
125
- end
126
115
 
127
- should "run it's parent and it's own blocks in the correct order" do
128
- obj = @test_status_class.new
116
+ obj = test_status_class.new
129
117
  subject.send("run_arounds", obj) do
130
118
  obj.instance_eval{ self.out_status += "TEST, " }
131
119
  end
132
120
 
133
- exp = "p-around start, c-around1 start, c-around2 start, "\
134
- "TEST, "\
135
- "c-around2 end, c-around1 end, p-around end."
136
- assert_equal exp, obj.out_status
121
+ exp =
122
+ "p-around start, c-around1 start, c-around2 start, "\
123
+ "TEST, "\
124
+ "c-around2 end, c-around1 end, p-around end."
125
+ assert_that(obj.out_status).equals(exp)
137
126
  end
138
127
  end
139
128
  end