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
@@ -7,10 +7,11 @@ require "assert/config"
7
7
  module Assert::Utils
8
8
  class UnitTests < Assert::Context
9
9
  desc "Assert::Utils"
10
- subject{ Assert::Utils }
11
- setup do
12
- @objs = [1, "hi there", Hash.new, [:a, :b]]
13
- end
10
+ subject { unit_class }
11
+
12
+ let(:unit_class) { Assert::Utils }
13
+
14
+ let(:objs1) { [1, "hi there", Hash.new, [:a, :b]] }
14
15
 
15
16
  should have_imeths :show, :show_for_diff
16
17
  should have_imeths :tempfile
@@ -20,41 +21,41 @@ module Assert::Utils
20
21
 
21
22
  class ShowTests < UnitTests
22
23
  desc "`show`"
23
- setup do
24
- @pp_config = Assert::Config.new({
24
+
25
+ let(:pp_config1) {
26
+ Assert::Config.new({
25
27
  :pp_objects => true,
26
28
  :pp_proc => Proc.new{ |input| "herp derp" }
27
29
  })
28
- end
30
+ }
29
31
 
30
32
  should "use `inspect` to show objs when `pp_objects` setting is false" do
31
- @objs.each do |obj|
32
- assert_equal obj.inspect, subject.show(obj, Factory.modes_off_config)
33
+ objs1.each do |obj|
34
+ assert_that(subject.show(obj, Factory.modes_off_config)).equals(obj.inspect)
33
35
  end
34
36
  end
35
37
 
36
38
  should "use `pp_proc` to show objs when `pp_objects` setting is true" do
37
- @objs.each do |obj|
38
- assert_equal @pp_config.pp_proc.call(obj), subject.show(obj, @pp_config)
39
+ objs1.each do |obj|
40
+ assert_that(subject.show(obj, pp_config1)).equals(pp_config1.pp_proc.call(obj))
39
41
  end
40
42
  end
41
43
  end
42
44
 
43
45
  class ShowForDiffTests < ShowTests
44
46
  desc "`show_for_diff`"
45
- setup do
46
- @w_newlines = { :string => "herp derp, derp herp\nherpderpedia" }
47
- @w_obj_id = Class.new.new
48
- end
47
+
48
+ let(:w_newlines1) { { :string => "herp derp, derp herp\nherpderpedia" } }
49
+ let(:w_obj_id1) { Class.new.new }
49
50
 
50
51
  should "call show, escaping newlines" do
51
52
  exp_out = "{:string=>\"herp derp, derp herp\nherpderpedia\"}"
52
- assert_equal exp_out, subject.show_for_diff(@w_newlines, Factory.modes_off_config)
53
+ assert_that(subject.show_for_diff(w_newlines1, Factory.modes_off_config)).equals(exp_out)
53
54
  end
54
55
 
55
56
  should "make any obj ids generic" do
56
57
  exp_out = "#<#<Class:0xXXXXXX>:0xXXXXXX>"
57
- assert_equal exp_out, subject.show_for_diff(@w_obj_id, Factory.modes_off_config)
58
+ assert_that(subject.show_for_diff(w_obj_id1, Factory.modes_off_config)).equals(exp_out)
58
59
  end
59
60
  end
60
61
 
@@ -63,12 +64,12 @@ module Assert::Utils
63
64
 
64
65
  should "require tempfile, open a tempfile, write the given content, and yield it" do
65
66
  subject.tempfile("a-name", "some-content") do |tmpfile|
66
- assert_equal false, (require "tempfile")
67
+ assert_that((require "tempfile")).equals(false)
67
68
  assert tmpfile
68
- assert_kind_of Tempfile, tmpfile
69
+ assert_that(tmpfile).is_kind_of(Tempfile)
69
70
 
70
71
  tmpfile.pos = 0
71
- assert_equal "some-content\n", tmpfile.read
72
+ assert_that(tmpfile.read).equals("some-content\n")
72
73
  end
73
74
  end
74
75
  end
@@ -77,63 +78,60 @@ module Assert::Utils
77
78
  desc "`stdlib_pp_proc`"
78
79
 
79
80
  should "build a pp proc that uses stdlib `PP.pp` to pretty print objects" do
80
- exp_obj_pps = @objs.map{ |o| PP.pp(o, "", 79).strip }
81
- act_obj_pps = @objs.map{ |o| subject.stdlib_pp_proc.call(o) }
82
- assert_equal exp_obj_pps, act_obj_pps
81
+ exp_obj_pps = objs1.map{ |o| PP.pp(o, "", 79).strip }
82
+ act_obj_pps = objs1.map{ |o| subject.stdlib_pp_proc.call(o) }
83
+ assert_that(act_obj_pps).equals(exp_obj_pps)
83
84
 
84
85
  cust_width = 1
85
- exp_obj_pps = @objs.map{ |o| PP.pp(o, "", cust_width).strip }
86
- act_obj_pps = @objs.map{ |o| subject.stdlib_pp_proc(cust_width).call(o) }
87
- assert_equal exp_obj_pps, act_obj_pps
86
+ exp_obj_pps = objs1.map{ |o| PP.pp(o, "", cust_width).strip }
87
+ act_obj_pps = objs1.map{ |o| subject.stdlib_pp_proc(cust_width).call(o) }
88
+ assert_that(act_obj_pps).equals(exp_obj_pps)
88
89
  end
89
90
  end
90
91
 
91
92
  class DefaultUseDiffProcTests < UnitTests
92
93
  desc "`default_use_diff_proc`"
93
- setup do
94
- @longer = "i am a really long string output; use diff when working with me"
95
- @newlines = "i have\n newlines"
96
- end
94
+
95
+ let(:longer1) { "i am a really long string output; use diff when working with me" }
96
+ let(:newlines1) { "i have\n newlines" }
97
97
 
98
98
  should "be true if either output has newlines or is bigger than 29 chars" do
99
99
  proc = subject.default_use_diff_proc
100
100
 
101
101
  assert_not proc.call("", "")
102
- assert proc.call(@longer, "")
103
- assert proc.call(@newlines, "")
104
- assert proc.call("", @longer)
105
- assert proc.call("", @newlines)
106
- assert proc.call(@longer, @newlines)
102
+ assert proc.call(longer1, "")
103
+ assert proc.call(newlines1, "")
104
+ assert proc.call("", longer1)
105
+ assert proc.call("", newlines1)
106
+ assert proc.call(longer1, newlines1)
107
107
  end
108
108
  end
109
109
 
110
110
  class SyscmdDiffProc < UnitTests
111
111
  desc "`syscmd_diff_proc`"
112
- setup do
113
- @diff_a_file = File.join(ROOT_PATH, "test/support/diff_a.txt")
114
- @diff_b_file = File.join(ROOT_PATH, "test/support/diff_b.txt")
115
112
 
116
- @diff_a = File.read(@diff_a_file)
117
- @diff_b = File.read(@diff_b_file)
118
- end
113
+ let(:diff_a_file1) { File.join(ROOT_PATH, "test/support/diff_a.txt") }
114
+ let(:diff_b_file1) { File.join(ROOT_PATH, "test/support/diff_b.txt") }
115
+ let(:diff_a1) { File.read(diff_a_file1) }
116
+ let(:diff_b1) { File.read(diff_b_file1) }
119
117
 
120
118
  should "use the diff syscmd to output the diff between the exp/act show output" do
121
- exp_diff_out = `diff --unified=-1 #{@diff_a_file} #{@diff_b_file}`.strip.tap do |out|
119
+ exp_diff_out = `diff --unified=-1 #{diff_a_file1} #{diff_b_file1}`.strip.tap do |out|
122
120
  out.sub!(/^\-\-\- .+/, "--- expected")
123
121
  out.sub!(/^\+\+\+ .+/, "+++ actual")
124
122
  end
125
123
 
126
- assert_equal exp_diff_out, subject.syscmd_diff_proc.call(@diff_a, @diff_b)
124
+ assert_that(subject.syscmd_diff_proc.call(diff_a1, diff_b1)).equals(exp_diff_out)
127
125
  end
128
126
 
129
127
  should "allow you to specify a custom syscmd" do
130
128
  cust_syscmd = "diff"
131
- exp_diff_out = `#{cust_syscmd} #{@diff_a_file} #{@diff_b_file}`.strip.tap do |out|
129
+ exp_diff_out = `#{cust_syscmd} #{diff_a_file1} #{diff_b_file1}`.strip.tap do |out|
132
130
  out.sub!(/^\-\-\- .+/, "--- expected")
133
131
  out.sub!(/^\+\+\+ .+/, "+++ actual")
134
132
  end
135
133
 
136
- assert_equal exp_diff_out, subject.syscmd_diff_proc(cust_syscmd).call(@diff_a, @diff_b)
134
+ assert_that(subject.syscmd_diff_proc(cust_syscmd).call(diff_a1, diff_b1)).equals(exp_diff_out)
137
135
  end
138
136
  end
139
137
  end
@@ -10,9 +10,11 @@ require "assert/view"
10
10
  module Assert::ViewHelpers
11
11
  class UnitTests < Assert::Context
12
12
  desc "Assert::ViewHelpers"
13
- setup do
14
- test_opt_val = @test_opt_val = Factory.string
15
- @helpers_class = Class.new do
13
+ subject { unit_class }
14
+
15
+ let(:unit_class) {
16
+ test_opt_val = test_opt_val1
17
+ Class.new do
16
18
  include Assert::ViewHelpers
17
19
 
18
20
  option "test_opt", test_opt_val
@@ -23,35 +25,33 @@ module Assert::ViewHelpers
23
25
  @config ||= [Assert.config, Assert::Config.new].sample
24
26
  end
25
27
  end
26
- end
27
- subject{ @helpers_class }
28
+ }
29
+
30
+ let(:test_opt_val1) { Factory.string }
28
31
 
29
32
  should have_imeths :option
30
33
 
31
34
  should "include the config helpers" do
32
- assert_includes Assert::ConfigHelpers, subject
35
+ assert_that(subject).includes(Assert::ConfigHelpers)
33
36
  end
34
37
 
35
38
  should "write option values" do
36
- helpers = @helpers_class.new
37
- assert_equal @test_opt_val, helpers.test_opt
39
+ helpers = unit_class.new
40
+ assert_that(helpers.test_opt).equals(test_opt_val1)
38
41
 
39
42
  new_val = Factory.integer
40
43
  helpers.test_opt new_val
41
- assert_equal new_val, helpers.test_opt
44
+ assert_that(helpers.test_opt).equals(new_val)
42
45
 
43
46
  other_val = Factory.integer
44
47
  helpers.test_opt new_val, other_val
45
- assert_equal [new_val, other_val], helpers.test_opt
48
+ assert_that(helpers.test_opt).equals([new_val, other_val])
46
49
  end
47
50
  end
48
51
 
49
52
  class InitTests < UnitTests
50
53
  desc "when init"
51
- setup do
52
- @helpers = @helpers_class.new
53
- end
54
- subject{ @helpers }
54
+ subject { unit_class.new }
55
55
 
56
56
  should have_imeths :captured_output, :re_run_test_cmd
57
57
  should have_imeths :tests_to_run_count_statement, :result_count_statement
@@ -61,107 +61,109 @@ module Assert::ViewHelpers
61
61
 
62
62
  should "know how to build captured output" do
63
63
  output = Factory.string
64
- exp = "--- stdout ---\n"\
65
- "#{output}"\
66
- "--------------"
67
- assert_equal exp, subject.captured_output(output)
64
+ exp =
65
+ "--- stdout ---\n"\
66
+ "#{output}"\
67
+ "--------------"
68
+ assert_that(subject.captured_output(output)).equals(exp)
68
69
  end
69
70
 
70
71
  should "know how to build the re-run test cmd" do
71
72
  test_id = "#{Dir.pwd}/#{Factory.string}_tests.rb:#{Factory.integer}"
72
73
  exp = "assert -t #{test_id.gsub(Dir.pwd, ".")}"
73
- assert_equal exp, subject.re_run_test_cmd(test_id)
74
+ assert_that(subject.re_run_test_cmd(test_id)).equals(exp)
74
75
  end
75
76
 
76
77
  should "know its tests-to-run count and result count statements" do
77
78
  exp = "#{subject.tests_to_run_count} test#{"s" if subject.tests_to_run_count != 1}"
78
- assert_equal exp, subject.tests_to_run_count_statement
79
+ assert_that(subject.tests_to_run_count_statement).equals(exp)
79
80
 
80
81
  exp = "#{subject.result_count} result#{"s" if subject.result_count != 1}"
81
- assert_equal exp, subject.result_count_statement
82
+ assert_that(subject.result_count_statement).equals(exp)
82
83
  end
83
84
 
84
85
  should "know how to build a sentence from a list of items" do
85
86
  items = 1.times.map{ Factory.string }
86
- assert_equal items.first, subject.to_sentence(items)
87
+ assert_that(subject.to_sentence(items)).equals(items.first)
87
88
 
88
89
  items = 2.times.map{ Factory.string }
89
- assert_equal items.join(" and "), subject.to_sentence(items)
90
+ assert_that(subject.to_sentence(items)).equals(items.join(" and "))
90
91
 
91
92
  items = (Factory.integer(3)+2).times.map{ Factory.string }
92
93
  exp = [items[0..-2].join(", "), items.last].join(", and ")
93
- assert_equal exp, subject.to_sentence(items)
94
+ assert_that(subject.to_sentence(items)).equals(exp)
94
95
  end
95
96
 
96
97
  should "know its all pass result summary message" do
97
98
  Assert.stub(subject, :result_count){ 0 }
98
- assert_equal "uhh...", subject.all_pass_result_summary_msg
99
+ assert_that(subject.all_pass_result_summary_msg).equals("uhh...")
99
100
 
100
101
  Assert.stub(subject, :result_count){ 1 }
101
- assert_equal "pass", subject.all_pass_result_summary_msg
102
+ assert_that(subject.all_pass_result_summary_msg).equals("pass")
102
103
 
103
104
  Assert.stub(subject, :result_count){ Factory.integer(10)+1 }
104
- assert_equal "all pass", subject.all_pass_result_summary_msg
105
+ assert_that(subject.all_pass_result_summary_msg).equals("all pass")
105
106
  end
106
107
 
107
108
  should "know its result summary msg" do
108
109
  res_type = :pass
109
110
  Assert.stub(subject, :all_pass?){ true }
110
111
  exp = subject.all_pass_result_summary_msg
111
- assert_equal exp, subject.result_summary_msg(res_type)
112
+ assert_that(subject.result_summary_msg(res_type)).equals(exp)
112
113
 
113
114
  Assert.stub(subject, :all_pass?){ false }
114
115
  res_type = [:pass, :ignore, :fail, :skip, :error].sample
115
116
  exp = "#{subject.send("#{res_type}_result_count")} #{res_type.to_s}"
116
- assert_equal exp, subject.result_summary_msg(res_type)
117
+ assert_that(subject.result_summary_msg(res_type)).equals(exp)
117
118
  end
118
119
 
119
120
  should "know its results summary sentence" do
120
- items = subject.ocurring_result_types.map do |result_sym|
121
- subject.result_summary_msg(result_sym)
122
- end
121
+ items =
122
+ subject.ocurring_result_types.map do |result_sym|
123
+ subject.result_summary_msg(result_sym)
124
+ end
123
125
  exp = subject.to_sentence(items)
124
- assert_equal exp, subject.results_summary_sentence
126
+ assert_that(subject.results_summary_sentence).equals(exp)
125
127
 
126
128
  block = proc{ |summary, result| "#{summary}--#{result}" }
127
- items = subject.ocurring_result_types.map do |result_sym|
128
- block.call(subject.result_summary_msg(result_sym), result_sym)
129
- end
129
+ items =
130
+ subject.ocurring_result_types.map do |result_sym|
131
+ block.call(subject.result_summary_msg(result_sym), result_sym)
132
+ end
130
133
  exp = subject.to_sentence(items)
131
- assert_equal exp, subject.results_summary_sentence(&block)
134
+ assert_that(subject.results_summary_sentence(&block)).equals(exp)
132
135
  end
133
136
  end
134
137
 
135
138
  class AnsiTests < UnitTests
136
139
  desc "Ansi"
137
- subject{ Ansi }
140
+ subject { Ansi }
138
141
 
139
142
  should have_imeths :code_for
140
143
 
141
144
  should "know its codes" do
142
- assert_not_empty subject::CODES
145
+ assert_that(subject::CODES).is_not_empty
143
146
  end
144
147
 
145
148
  should "map its code style names to ansi code strings" do
146
149
  styles = Factory.integer(3).times.map{ subject::CODES.keys.sample }
147
150
  exp = styles.map{ |n| "\e[#{subject::CODES[n]}m" }.join("")
148
- assert_equal exp, subject.code_for(*styles)
151
+ assert_that(subject.code_for(*styles)).equals(exp)
149
152
 
150
153
  styles = Factory.integer(3).times.map{ Factory.string }
151
- assert_equal "", subject.code_for(*styles)
154
+ assert_that(subject.code_for(*styles)).equals("")
152
155
 
153
156
  styles = []
154
- assert_equal "", subject.code_for(*styles)
157
+ assert_that(subject.code_for(*styles)).equals("")
155
158
  end
156
159
  end
157
160
 
158
161
  class AnsiInitTests < UnitTests
159
162
  desc "when mixed in on a view"
160
- setup do
161
- view_class = Class.new(Assert::View){ include Ansi }
162
- @view = view_class.new(Factory.modes_off_config, StringIO.new("", "w+"))
163
- end
164
- subject{ @view }
163
+ subject { view1 }
164
+
165
+ let(:view_class1) { Class.new(Assert::View){ include Ansi } }
166
+ let(:view1) { view_class1.new(Factory.modes_off_config, StringIO.new("", "w+")) }
165
167
 
166
168
  should have_imeths :ansi_styled_msg
167
169
 
@@ -171,26 +173,26 @@ module Assert::ViewHelpers
171
173
 
172
174
  Assert.stub(subject, :is_tty?){ false }
173
175
  Assert.stub(subject, :styled){ false }
174
- assert_equal msg, subject.ansi_styled_msg(msg, result_type)
176
+ assert_that(subject.ansi_styled_msg(msg, result_type)).equals(msg)
175
177
 
176
178
  Assert.stub(subject, :is_tty?){ false }
177
179
  Assert.stub(subject, :styled){ true }
178
- assert_equal msg, subject.ansi_styled_msg(msg, result_type)
180
+ assert_that(subject.ansi_styled_msg(msg, result_type)).equals(msg)
179
181
 
180
182
  Assert.stub(subject, :is_tty?){ true }
181
183
  Assert.stub(subject, :styled){ false }
182
- assert_equal msg, subject.ansi_styled_msg(msg, result_type)
184
+ assert_that(subject.ansi_styled_msg(msg, result_type)).equals(msg)
183
185
 
184
186
  Assert.stub(subject, :is_tty?){ true }
185
187
  Assert.stub(subject, :styled){ true }
186
188
  Assert.stub(subject, "#{result_type}_styles"){ [] }
187
- assert_equal msg, subject.ansi_styled_msg(msg, result_type)
189
+ assert_that(subject.ansi_styled_msg(msg, result_type)).equals(msg)
188
190
 
189
191
  styles = Factory.integer(3).times.map{ Assert::ViewHelpers::Ansi::CODES.keys.sample }
190
192
  Assert.stub(subject, "#{result_type}_styles"){ styles }
191
193
  exp_code = Assert::ViewHelpers::Ansi.code_for(*styles)
192
194
  exp = exp_code + msg + Assert::ViewHelpers::Ansi.code_for(:reset)
193
- assert_equal exp, subject.ansi_styled_msg(msg, result_type)
195
+ assert_that(subject.ansi_styled_msg(msg, result_type)).equals(exp)
194
196
  end
195
197
  end
196
198
  end
@@ -9,28 +9,27 @@ require "assert/view_helpers"
9
9
  class Assert::View
10
10
  class UnitTests < Assert::Context
11
11
  desc "Assert::View"
12
- subject { Assert::View }
12
+ subject { unit_class }
13
+
14
+ let(:unit_class) { Assert::View }
13
15
 
14
16
  should have_instance_method :require_user_view
15
17
 
16
18
  should "include the config helpers" do
17
- assert_includes Assert::ConfigHelpers, subject
19
+ assert_that(subject).includes(Assert::ConfigHelpers)
18
20
  end
19
21
 
20
22
  should "include the view helpers" do
21
- assert_includes Assert::ViewHelpers, subject
23
+ assert_that(subject).includes(Assert::ViewHelpers)
22
24
  end
23
25
  end
24
26
 
25
27
  class InitTests < UnitTests
26
28
  desc "when init"
27
- setup do
28
- @io = StringIO.new("", "w+")
29
- @config = Factory.modes_off_config
29
+ subject { Assert::View.new(config1, io1) }
30
30
 
31
- @view = Assert::View.new(@config, @io)
32
- end
33
- subject{ @view }
31
+ let(:io1) { StringIO.new("", "w+") }
32
+ let(:config1) { Factory.modes_off_config }
34
33
 
35
34
  should have_readers :config
36
35
  should have_imeths :view, :is_tty?
@@ -39,33 +38,33 @@ class Assert::View
39
38
  should have_imeths :before_test, :after_test, :on_result
40
39
 
41
40
  should "default its style options" do
42
- assert_false subject.styled
41
+ assert_that(subject.styled).is_false
43
42
 
44
- assert_nil subject.pass_styles
45
- assert_nil subject.fail_styles
46
- assert_nil subject.error_styles
47
- assert_nil subject.skip_styles
48
- assert_nil subject.ignore_styles
43
+ assert_that(subject.pass_styles).is_nil
44
+ assert_that(subject.fail_styles).is_nil
45
+ assert_that(subject.error_styles).is_nil
46
+ assert_that(subject.skip_styles).is_nil
47
+ assert_that(subject.ignore_styles).is_nil
49
48
  end
50
49
 
51
50
  should "default its result abbreviations" do
52
- assert_equal ".", subject.pass_abbrev
53
- assert_equal "F", subject.fail_abbrev
54
- assert_equal "I", subject.ignore_abbrev
55
- assert_equal "S", subject.skip_abbrev
56
- assert_equal "E", subject.error_abbrev
51
+ assert_that(subject.pass_abbrev).equals(".")
52
+ assert_that(subject.fail_abbrev).equals("F")
53
+ assert_that(subject.ignore_abbrev).equals("I")
54
+ assert_that(subject.skip_abbrev).equals("S")
55
+ assert_that(subject.error_abbrev).equals("E")
57
56
  end
58
57
 
59
58
  should "know its config" do
60
- assert_equal @config, subject.config
59
+ assert_that(subject.config).equals(config1)
61
60
  end
62
61
 
63
62
  should "override the config helper's view value with itself" do
64
- assert_equal subject, subject.view
63
+ assert_that(subject.view).equals(subject)
65
64
  end
66
65
 
67
66
  should "know if it is a tty" do
68
- assert_equal !!@io.isatty, subject.is_tty?
67
+ assert_that(subject.is_tty?).equals(!!io1.isatty)
69
68
  end
70
69
  end
71
70
  end