assert 2.17.0 → 2.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/README.md +66 -41
  4. data/assert.gemspec +2 -3
  5. data/lib/assert.rb +0 -10
  6. data/lib/assert/actual_value.rb +127 -0
  7. data/lib/assert/assert_runner.rb +0 -3
  8. data/lib/assert/assertions.rb +10 -23
  9. data/lib/assert/cli.rb +30 -46
  10. data/lib/assert/config.rb +0 -4
  11. data/lib/assert/config_helpers.rb +0 -4
  12. data/lib/assert/context.rb +18 -9
  13. data/lib/assert/context/let_dsl.rb +13 -0
  14. data/lib/assert/context/method_missing.rb +19 -0
  15. data/lib/assert/context/setup_dsl.rb +0 -4
  16. data/lib/assert/context/subject_dsl.rb +23 -28
  17. data/lib/assert/context/suite_dsl.rb +0 -4
  18. data/lib/assert/context/test_dsl.rb +0 -4
  19. data/lib/assert/context_info.rb +0 -4
  20. data/lib/assert/default_runner.rb +0 -4
  21. data/lib/assert/default_suite.rb +0 -5
  22. data/lib/assert/default_view.rb +0 -4
  23. data/lib/assert/factory.rb +0 -3
  24. data/lib/assert/file_line.rb +0 -4
  25. data/lib/assert/macro.rb +0 -3
  26. data/lib/assert/macros/methods.rb +4 -10
  27. data/lib/assert/result.rb +2 -17
  28. data/lib/assert/runner.rb +0 -3
  29. data/lib/assert/stub.rb +15 -1
  30. data/lib/assert/suite.rb +0 -4
  31. data/lib/assert/test.rb +2 -7
  32. data/lib/assert/utils.rb +0 -4
  33. data/lib/assert/version.rb +1 -1
  34. data/lib/assert/view.rb +0 -3
  35. data/lib/assert/view_helpers.rb +0 -11
  36. data/log/{.gitkeep → .keep} +0 -0
  37. data/test/helper.rb +23 -29
  38. data/test/support/factory.rb +14 -0
  39. data/test/support/inherited_stuff.rb +0 -2
  40. data/test/system/stub_tests.rb +332 -352
  41. data/test/system/test_tests.rb +98 -124
  42. data/test/unit/actual_value_tests.rb +335 -0
  43. data/test/unit/assert_tests.rb +121 -46
  44. data/test/unit/assertions/assert_block_tests.rb +30 -35
  45. data/test/unit/assertions/assert_empty_tests.rb +33 -35
  46. data/test/unit/assertions/assert_equal_tests.rb +75 -83
  47. data/test/unit/assertions/assert_file_exists_tests.rb +32 -36
  48. data/test/unit/assertions/assert_includes_tests.rb +38 -41
  49. data/test/unit/assertions/assert_instance_of_tests.rb +34 -37
  50. data/test/unit/assertions/assert_kind_of_tests.rb +34 -37
  51. data/test/unit/assertions/assert_match_tests.rb +34 -37
  52. data/test/unit/assertions/assert_nil_tests.rb +30 -35
  53. data/test/unit/assertions/assert_raises_tests.rb +54 -60
  54. data/test/unit/assertions/assert_respond_to_tests.rb +36 -39
  55. data/test/unit/assertions/assert_same_tests.rb +86 -88
  56. data/test/unit/assertions/assert_true_false_tests.rb +60 -66
  57. data/test/unit/assertions_tests.rb +14 -17
  58. data/test/unit/config_helpers_tests.rb +41 -39
  59. data/test/unit/config_tests.rb +38 -37
  60. data/test/unit/context/let_dsl_tests.rb +10 -0
  61. data/test/unit/context/setup_dsl_tests.rb +68 -87
  62. data/test/unit/context/subject_dsl_tests.rb +15 -49
  63. data/test/unit/context/suite_dsl_tests.rb +15 -20
  64. data/test/unit/context/test_dsl_tests.rb +50 -57
  65. data/test/unit/context_info_tests.rb +23 -18
  66. data/test/unit/context_tests.rb +183 -194
  67. data/test/unit/default_runner_tests.rb +1 -7
  68. data/test/unit/default_suite_tests.rb +57 -56
  69. data/test/unit/factory_tests.rb +5 -6
  70. data/test/unit/file_line_tests.rb +33 -39
  71. data/test/unit/macro_tests.rb +14 -18
  72. data/test/unit/result_tests.rb +159 -196
  73. data/test/unit/runner_tests.rb +64 -71
  74. data/test/unit/suite_tests.rb +58 -59
  75. data/test/unit/test_tests.rb +125 -136
  76. data/test/unit/utils_tests.rb +43 -54
  77. data/test/unit/view_helpers_tests.rb +54 -58
  78. data/test/unit/view_tests.rb +22 -27
  79. metadata +15 -10
  80. data/tmp/.gitkeep +0 -0
@@ -4,121 +4,115 @@ require "assert/assertions"
4
4
  require "assert/utils"
5
5
 
6
6
  module Assert::Assertions
7
-
8
7
  class AssertTrueTests < Assert::Context
9
8
  include Assert::Test::TestHelpers
10
9
 
11
10
  desc "`assert_true`"
12
- setup do
13
- desc = @desc = "assert true fail desc"
14
- args = @args = ["whatever", desc]
15
- @test = Factory.test do
11
+ subject {
12
+ args = args1
13
+ Factory.test do
16
14
  assert_true(true) # pass
17
15
  assert_true(*args) # fail
18
16
  end
19
- @c = @test.config
20
- @test.run(&test_run_callback)
21
- end
22
- subject{ @test }
17
+ }
18
+
19
+ let(:desc1) { "assert true fail desc" }
20
+ let(:args1) { ["whatever", desc1] }
21
+ let(:config1) { subject.config }
23
22
 
24
23
  should "produce results as expected" do
25
- assert_equal 2, test_run_result_count
26
- assert_equal 1, test_run_result_count(:pass)
27
- assert_equal 1, test_run_result_count(:fail)
28
- end
24
+ subject.run(&test_run_callback)
29
25
 
30
- should "have a fail message with custom and generic explanations" do
31
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to be true."
32
- assert_equal exp, test_run_results(:fail).first.message
33
- end
26
+ assert_that(test_run_result_count).equals(2)
27
+ assert_that(test_run_result_count(:pass)).equals(1)
28
+ assert_that(test_run_result_count(:fail)).equals(1)
34
29
 
30
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be true."
31
+ assert_that(test_run_results(:fail).first.message).equals(exp)
32
+ end
35
33
  end
36
34
 
37
35
  class AssertNotTrueTests < Assert::Context
38
36
  include Assert::Test::TestHelpers
39
37
 
40
38
  desc "`assert_not_true`"
41
- setup do
42
- desc = @desc = "assert not true fail desc"
43
- args = @args = [true, desc]
44
- @test = Factory.test do
39
+ subject {
40
+ args = args1
41
+ Factory.test do
45
42
  assert_not_true(false) # pass
46
43
  assert_not_true(*args) # fail
47
44
  end
48
- @c = @test.config
49
- @test.run(&test_run_callback)
50
- end
51
- subject{ @test }
45
+ }
46
+
47
+ let(:desc1) { "assert not true fail desc" }
48
+ let(:args1) { [true, desc1] }
49
+ let(:config1) { subject.config }
52
50
 
53
51
  should "produce results as expected" do
54
- assert_equal 2, test_run_result_count
55
- assert_equal 1, test_run_result_count(:pass)
56
- assert_equal 1, test_run_result_count(:fail)
57
- end
52
+ subject.run(&test_run_callback)
58
53
 
59
- should "have a fail message with custom and generic explanations" do
60
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not be true."
61
- assert_equal exp, test_run_results(:fail).first.message
62
- end
54
+ assert_that(test_run_result_count).equals(2)
55
+ assert_that(test_run_result_count(:pass)).equals(1)
56
+ assert_that(test_run_result_count(:fail)).equals(1)
63
57
 
58
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not be true."
59
+ assert_that(test_run_results(:fail).first.message).equals(exp)
60
+ end
64
61
  end
65
62
 
66
63
  class AssertFalseTests < Assert::Context
67
64
  include Assert::Test::TestHelpers
68
65
 
69
66
  desc "`assert_false`"
70
- setup do
71
- desc = @desc = "assert false fail desc"
72
- args = @args = ["whatever", desc]
73
- @test = Factory.test do
67
+ subject {
68
+ args = args1
69
+ Factory.test do
74
70
  assert_false(false) # pass
75
71
  assert_false(*args) # fail
76
72
  end
77
- @c = @test.config
78
- @test.run(&test_run_callback)
79
- end
80
- subject{ @test }
73
+ }
74
+
75
+ let(:desc1) { "assert false fail desc" }
76
+ let(:args1) { ["whatever", desc1] }
77
+ let(:config1) { subject.config }
81
78
 
82
79
  should "produce results as expected" do
83
- assert_equal 2, test_run_result_count
84
- assert_equal 1, test_run_result_count(:pass)
85
- assert_equal 1, test_run_result_count(:fail)
86
- end
80
+ subject.run(&test_run_callback)
87
81
 
88
- should "have a fail message with custom and generic explanations" do
89
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to be false."
90
- assert_equal exp, test_run_results(:fail).first.message
91
- end
82
+ assert_that(test_run_result_count).equals(2)
83
+ assert_that(test_run_result_count(:pass)).equals(1)
84
+ assert_that(test_run_result_count(:fail)).equals(1)
92
85
 
86
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be false."
87
+ assert_that(test_run_results(:fail).first.message).equals(exp)
88
+ end
93
89
  end
94
90
 
95
91
  class AssertNotFalseTests < Assert::Context
96
92
  include Assert::Test::TestHelpers
97
93
 
98
94
  desc "`assert_not_false`"
99
- setup do
100
- desc = @desc = "assert not false fail desc"
101
- args = @args = [false, desc]
102
- @test = Factory.test do
95
+ subject {
96
+ args = args1
97
+ Factory.test do
103
98
  assert_not_false(true) # pass
104
99
  assert_not_false(*args) # fail
105
100
  end
106
- @c = @test.config
107
- @test.run(&test_run_callback)
108
- end
109
- subject{ @test }
101
+ }
102
+
103
+ let(:desc1) { "assert not false fail desc" }
104
+ let(:args1) { [false, desc1] }
105
+ let(:config1) { subject.config }
110
106
 
111
107
  should "produce results as expected" do
112
- assert_equal 2, test_run_result_count
113
- assert_equal 1, test_run_result_count(:pass)
114
- assert_equal 1, test_run_result_count(:fail)
115
- end
108
+ subject.run(&test_run_callback)
116
109
 
117
- should "have a fail message with custom and generic explanations" do
118
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not be false."
119
- assert_equal exp, test_run_results(:fail).first.message
120
- end
110
+ assert_that(test_run_result_count).equals(2)
111
+ assert_that(test_run_result_count(:pass)).equals(1)
112
+ assert_that(test_run_result_count(:fail)).equals(1)
121
113
 
114
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not be false."
115
+ assert_that(test_run_results(:fail).first.message).equals(exp)
116
+ end
122
117
  end
123
-
124
118
  end
@@ -2,17 +2,14 @@ require "assert"
2
2
  require "assert/assertions"
3
3
 
4
4
  module Assert::Assertions
5
-
6
5
  class UnitTests < Assert::Context
7
6
  include Assert::Test::TestHelpers
8
7
 
9
8
  desc "Assert::Context"
10
- setup do
11
- @context_class = Factory.modes_off_context_class
12
- @test = Factory.test
13
- @context = @context_class.new(@test, @test.config, proc{ |r| })
14
- end
15
- subject{ @context }
9
+ subject { context_class1.new(test1, test1.config, proc { |r| }) }
10
+
11
+ let(:context_class1) { Factory.modes_off_context_class }
12
+ let(:test1) { Factory.test }
16
13
 
17
14
  should have_imeths :assert_block, :assert_not_block, :refute_block
18
15
  should have_imeths :assert_raises, :assert_not_raises
@@ -33,27 +30,29 @@ module Assert::Assertions
33
30
  should have_imeths :assert_true, :assert_not_true, :refute_true
34
31
  should have_imeths :assert_false, :assert_not_false, :refute_false
35
32
  should have_imeths :assert_file_exists, :assert_not_file_exists, :refute_file_exists
36
-
37
33
  end
38
34
 
39
35
  class IgnoredTests < UnitTests
40
36
  desc "ignored assertions helpers"
41
37
  setup do
42
- @tests = Assert::Assertions::IGNORED_ASSERTION_HELPERS.map do |helper|
43
- context_info = Factory.context_info(@context_class)
38
+ tests.each{ |test| test.run(&test_run_callback) }
39
+ end
40
+
41
+ let(:tests) {
42
+ context_info = Factory.context_info(context_class1)
43
+ Assert::Assertions::IGNORED_ASSERTION_HELPERS.map do |helper|
44
44
  Factory.test("ignored assertion helper #{helper}", context_info) do
45
45
  self.send(helper, "doesn't matter")
46
46
  end
47
47
  end
48
- @tests.each{ |test| test.run(&test_run_callback) }
49
- end
48
+ }
50
49
 
51
50
  should "have an ignored result for each helper in the constant" do
52
51
  exp = Assert::Assertions::IGNORED_ASSERTION_HELPERS.size
53
- assert_equal exp, test_run_result_count
52
+ assert_that(test_run_result_count).equals(exp)
54
53
 
55
54
  test_run_results.each do |result|
56
- assert_kind_of Assert::Result::Ignore, result
55
+ assert_that(result).is_kind_of(Assert::Result::Ignore)
57
56
  end
58
57
  end
59
58
 
@@ -62,9 +61,7 @@ module Assert::Assertions
62
61
  "The assertion `#{helper}` is not supported."\
63
62
  " Please use another assertion or the basic `assert`."
64
63
  end
65
- assert_equal exp, test_run_results.collect(&:message)
64
+ assert_that(test_run_results.collect(&:message)).equals(exp)
66
65
  end
67
-
68
66
  end
69
-
70
67
  end
@@ -4,22 +4,26 @@ require "assert/config_helpers"
4
4
  require "assert/config"
5
5
 
6
6
  module Assert::ConfigHelpers
7
-
8
7
  class UnitTests < Assert::Context
9
8
  desc "Assert::ConfigHelpers"
10
- setup do
11
- @helpers_class = Class.new do
9
+ subject { unit_class }
10
+
11
+ let(:unit_class) {
12
+ Class.new do
12
13
  include Assert::ConfigHelpers
13
14
 
14
15
  def config
15
16
  # use the assert config since it has tests, contexts, etc
16
- # also maybe use a fresh config that is empty
17
+ # also use a fresh config that is empty
17
18
  @config ||= [Assert.config, Assert::Config.new].sample
18
19
  end
19
20
  end
20
- @helpers = @helpers_class.new
21
- end
22
- subject{ @helpers }
21
+ }
22
+ end
23
+
24
+ class InitTests < UnitTests
25
+ desc "when init"
26
+ subject { unit_class.new }
23
27
 
24
28
  should have_imeths :runner, :suite, :view
25
29
  should have_imeths :runner_seed, :single_test?, :single_test_file_line
@@ -35,67 +39,67 @@ module Assert::ConfigHelpers
35
39
  should have_imeths :ocurring_result_types
36
40
 
37
41
  should "know the config's runner, suite and view" do
38
- assert_equal subject.config.runner, subject.runner
39
- assert_equal subject.config.suite, subject.suite
40
- 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)
41
45
  end
42
46
 
43
47
  should "know its runner seed" do
44
- assert_equal subject.config.runner_seed, subject.runner_seed
48
+ assert_that(subject.runner_seed).equals(subject.config.runner_seed)
45
49
  end
46
50
 
47
51
  should "know if it is in single test mode" do
48
52
  Assert.stub(subject.config, :single_test?){ true }
49
- assert_true subject.single_test?
53
+ assert_that(subject.single_test?).is_true
50
54
 
51
55
  Assert.stub(subject.config, :single_test?){ false }
52
- assert_false subject.single_test?
56
+ assert_that(subject.single_test?).is_false
53
57
  end
54
58
 
55
59
  should "know its single test file line" do
56
60
  exp = subject.config.single_test_file_line
57
- assert_equal exp, subject.single_test_file_line
61
+ assert_that(subject.single_test_file_line).equals(exp)
58
62
  end
59
63
 
60
64
  should "know its tests-to-run attrs" do
61
65
  exp = subject.config.suite.tests_to_run?
62
- assert_equal exp, subject.tests_to_run?
66
+ assert_that(subject.tests_to_run?).equals(exp)
63
67
 
64
68
  exp = subject.config.suite.tests_to_run_count
65
- assert_equal exp, subject.tests_to_run_count
69
+ assert_that(subject.tests_to_run_count).equals(exp)
66
70
  end
67
71
 
68
72
  should "know its test/result counts" do
69
73
  exp = subject.config.suite.test_count
70
- assert_equal exp, subject.test_count
74
+ assert_that(subject.test_count).equals(exp)
71
75
 
72
76
  exp = subject.config.suite.result_count
73
- assert_equal exp, subject.result_count
77
+ assert_that(subject.result_count).equals(exp)
74
78
 
75
79
  exp = subject.config.suite.pass_result_count
76
- assert_equal exp, subject.pass_result_count
80
+ assert_that(subject.pass_result_count).equals(exp)
77
81
 
78
82
  exp = subject.config.suite.fail_result_count
79
- assert_equal exp, subject.fail_result_count
83
+ assert_that(subject.fail_result_count).equals(exp)
80
84
 
81
85
  exp = subject.config.suite.error_result_count
82
- assert_equal exp, subject.error_result_count
86
+ assert_that(subject.error_result_count).equals(exp)
83
87
 
84
88
  exp = subject.config.suite.skip_result_count
85
- assert_equal exp, subject.skip_result_count
89
+ assert_that(subject.skip_result_count).equals(exp)
86
90
 
87
91
  exp = subject.config.suite.ignore_result_count
88
- assert_equal exp, subject.ignore_result_count
92
+ assert_that(subject.ignore_result_count).equals(exp)
89
93
  end
90
94
 
91
95
  should "know if all tests are passing or not" do
92
96
  result_count = Factory.integer
93
97
  Assert.stub(subject, :result_count){ result_count }
94
98
  Assert.stub(subject, :pass_result_count){ result_count }
95
- assert_true subject.all_pass?
99
+ assert_that(subject.all_pass?).is_true
96
100
 
97
101
  Assert.stub(subject, :pass_result_count){ Factory.integer }
98
- assert_false subject.all_pass?
102
+ assert_that(subject.all_pass?).is_false
99
103
  end
100
104
 
101
105
  should "know its formatted run time, test rate and result rate" do
@@ -103,39 +107,39 @@ module Assert::ConfigHelpers
103
107
 
104
108
  run_time = Factory.float
105
109
  exp = format % run_time
106
- assert_equal exp, subject.formatted_run_time(run_time, format)
107
- 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)
108
112
 
109
113
  test_rate = Factory.float
110
114
  exp = format % test_rate
111
- assert_equal exp, subject.formatted_result_rate(test_rate, format)
112
- 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)
113
117
 
114
118
  result_rate = Factory.float
115
119
  exp = format % result_rate
116
- assert_equal exp, subject.formatted_result_rate(result_rate, format)
117
- 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)
118
122
  end
119
123
 
120
124
  should "know its formatted suite run time, test rate and result rate" do
121
125
  format = "%.6f"
122
126
 
123
127
  exp = format % subject.config.suite.run_time
124
- assert_equal exp, subject.formatted_suite_run_time(format)
128
+ assert_that(subject.formatted_suite_run_time(format)).equals(exp)
125
129
 
126
130
  exp = format % subject.config.suite.test_rate
127
- assert_equal exp, subject.formatted_suite_test_rate(format)
131
+ assert_that(subject.formatted_suite_test_rate(format)).equals(exp)
128
132
 
129
133
  exp = format % subject.config.suite.result_rate
130
- assert_equal exp, subject.formatted_suite_result_rate(format)
134
+ assert_that(subject.formatted_suite_result_rate(format)).equals(exp)
131
135
  end
132
136
 
133
137
  should "know whether to show test profile info" do
134
- assert_equal !!subject.config.profile, subject.show_test_profile_info?
138
+ assert_that(subject.show_test_profile_info?).equals(!!subject.config.profile)
135
139
  end
136
140
 
137
141
  should "know whether to show verbose info" do
138
- assert_equal !!subject.config.verbose, subject.show_test_verbose_info?
142
+ assert_that(subject.show_test_verbose_info?).equals(!!subject.config.verbose)
139
143
  end
140
144
 
141
145
  should "know what result types occur in a suite's results" do
@@ -146,9 +150,7 @@ module Assert::ConfigHelpers
146
150
  exp = result_types.select do |type_sym|
147
151
  subject.send("#{type_sym}_result_count") > 0
148
152
  end
149
- assert_equal exp, subject.ocurring_result_types
153
+ assert_that(subject.ocurring_result_types).equals(exp)
150
154
  end
151
-
152
155
  end
153
-
154
156
  end
@@ -8,13 +8,16 @@ require "assert/file_line"
8
8
  require "assert/runner"
9
9
 
10
10
  class Assert::Config
11
-
12
11
  class UnitTests < Assert::Context
13
12
  desc "Assert::Config"
14
- setup do
15
- @config = Assert::Config.new
16
- end
17
- 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 }
18
21
 
19
22
  should have_imeths :view, :suite, :runner
20
23
  should have_imeths :test_dir, :test_helper, :test_file_suffixes
@@ -26,75 +29,73 @@ class Assert::Config
26
29
  should have_imeths :single_test_file_line, :single_test_file_path
27
30
 
28
31
  should "default the view, suite, and runner" do
29
- assert_kind_of Assert::DefaultView, subject.view
30
- assert_kind_of Assert::DefaultSuite, subject.suite
31
- 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)
32
35
  end
33
36
 
34
37
  should "default the test dir/helper/suffixes" do
35
- assert_equal "test", subject.test_dir
36
- assert_equal "helper.rb", subject.test_helper
37
- 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"])
38
41
  end
39
42
 
40
43
  should "default the procs" do
41
- assert_not_nil subject.changed_proc
42
- assert_not_nil subject.pp_proc
43
- assert_not_nil subject.use_diff_proc
44
- 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
45
48
  end
46
49
 
47
50
  should "default the option settings" do
48
- assert_not_nil subject.runner_seed
49
- assert_not subject.changed_only
50
- assert_empty subject.changed_ref
51
- assert_empty subject.single_test
52
- assert_not subject.pp_objects
53
- assert_not subject.capture_output
54
- assert subject.halt_on_fail
55
- assert_not subject.profile
56
- assert_not subject.verbose
57
- assert_not subject.list
58
- 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
59
62
  end
60
63
 
61
64
  should "apply settings given from a hash" do
62
65
  assert subject.halt_on_fail
63
66
  subject.apply(:halt_on_fail => false)
64
- assert_not subject.halt_on_fail
67
+ assert_that(subject.halt_on_fail).is_false
65
68
 
66
- assert Assert::Config.new.halt_on_fail
67
- 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
68
71
  end
69
72
 
70
73
  should "know if it is in single test mode" do
71
- assert_false subject.single_test?
74
+ assert_that(subject.single_test?).is_false
72
75
 
73
76
  subject.apply(:single_test => Factory.string)
74
- assert_true subject.single_test?
77
+ assert_that(subject.single_test?).is_true
75
78
  end
76
79
 
77
80
  should "know its single test file line" do
78
81
  exp = Assert::FileLine.parse(File.expand_path("", Dir.pwd))
79
- assert_equal exp, subject.single_test_file_line
82
+ assert_that(subject.single_test_file_line).equals(exp)
80
83
 
81
84
  file_line_path = "#{Factory.path}_tests.rb:#{Factory.integer}"
82
85
  subject.apply(:single_test => file_line_path)
83
86
 
84
87
  exp = Assert::FileLine.parse(File.expand_path(file_line_path, Dir.pwd))
85
- assert_equal exp, subject.single_test_file_line
88
+ assert_that(subject.single_test_file_line).equals(exp)
86
89
  end
87
90
 
88
91
  should "know its single test file path" do
89
92
  exp = Assert::FileLine.parse(File.expand_path("", Dir.pwd)).file
90
- assert_equal exp, subject.single_test_file_path
93
+ assert_that(subject.single_test_file_path).equals(exp)
91
94
 
92
95
  path = "#{Factory.path}_tests.rb"
93
96
  file_line_path = "#{path}:#{Factory.integer}"
94
97
  subject.apply(:single_test => file_line_path)
95
- 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))
96
99
  end
97
-
98
100
  end
99
-
100
101
  end