assert 2.18.2 → 2.18.3

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