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
@@ -8,27 +8,28 @@ module Assert::Assertions
8
8
  include Assert::Test::TestHelpers
9
9
 
10
10
  desc "`assert_true`"
11
- setup do
12
- desc = @desc = "assert true fail desc"
13
- args = @args = ["whatever", desc]
14
- @test = Factory.test do
11
+ subject { test1 }
12
+
13
+ let(:desc1) { "assert true fail desc" }
14
+ let(:args1) { ["whatever", desc1] }
15
+ let(:test1) {
16
+ args = args1
17
+ Factory.test do
15
18
  assert_true(true) # pass
16
19
  assert_true(*args) # fail
17
20
  end
18
- @c = @test.config
19
- @test.run(&test_run_callback)
20
- end
21
- subject{ @test }
21
+ }
22
+ let(:config1) { test1.config }
22
23
 
23
24
  should "produce results as expected" do
24
- assert_equal 2, test_run_result_count
25
- assert_equal 1, test_run_result_count(:pass)
26
- assert_equal 1, test_run_result_count(:fail)
27
- end
25
+ subject.run(&test_run_callback)
26
+
27
+ assert_that(test_run_result_count).equals(2)
28
+ assert_that(test_run_result_count(:pass)).equals(1)
29
+ assert_that(test_run_result_count(:fail)).equals(1)
28
30
 
29
- should "have a fail message with custom and generic explanations" do
30
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to be true."
31
- assert_equal exp, test_run_results(:fail).first.message
31
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be true."
32
+ assert_that(test_run_results(:fail).first.message).equals(exp)
32
33
  end
33
34
  end
34
35
 
@@ -36,27 +37,28 @@ module Assert::Assertions
36
37
  include Assert::Test::TestHelpers
37
38
 
38
39
  desc "`assert_not_true`"
39
- setup do
40
- desc = @desc = "assert not true fail desc"
41
- args = @args = [true, desc]
42
- @test = Factory.test do
40
+ subject { test1 }
41
+
42
+ let(:desc1) { "assert not true fail desc" }
43
+ let(:args1) { [true, desc1] }
44
+ let(:test1) {
45
+ args = args1
46
+ Factory.test do
43
47
  assert_not_true(false) # pass
44
48
  assert_not_true(*args) # fail
45
49
  end
46
- @c = @test.config
47
- @test.run(&test_run_callback)
48
- end
49
- subject{ @test }
50
+ }
51
+ let(:config1) { test1.config }
50
52
 
51
53
  should "produce results as expected" do
52
- assert_equal 2, test_run_result_count
53
- assert_equal 1, test_run_result_count(:pass)
54
- assert_equal 1, test_run_result_count(:fail)
55
- end
54
+ subject.run(&test_run_callback)
55
+
56
+ assert_that(test_run_result_count).equals(2)
57
+ assert_that(test_run_result_count(:pass)).equals(1)
58
+ assert_that(test_run_result_count(:fail)).equals(1)
56
59
 
57
- should "have a fail message with custom and generic explanations" do
58
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not be true."
59
- assert_equal exp, test_run_results(:fail).first.message
60
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not be true."
61
+ assert_that(test_run_results(:fail).first.message).equals(exp)
60
62
  end
61
63
  end
62
64
 
@@ -64,27 +66,28 @@ module Assert::Assertions
64
66
  include Assert::Test::TestHelpers
65
67
 
66
68
  desc "`assert_false`"
67
- setup do
68
- desc = @desc = "assert false fail desc"
69
- args = @args = ["whatever", desc]
70
- @test = Factory.test do
69
+ subject { test1 }
70
+
71
+ let(:desc1) { "assert false fail desc" }
72
+ let(:args1) { ["whatever", desc1] }
73
+ let(:test1) {
74
+ args = args1
75
+ Factory.test do
71
76
  assert_false(false) # pass
72
77
  assert_false(*args) # fail
73
78
  end
74
- @c = @test.config
75
- @test.run(&test_run_callback)
76
- end
77
- subject{ @test }
79
+ }
80
+ let(:config1) { test1.config }
78
81
 
79
82
  should "produce results as expected" do
80
- assert_equal 2, test_run_result_count
81
- assert_equal 1, test_run_result_count(:pass)
82
- assert_equal 1, test_run_result_count(:fail)
83
- end
83
+ subject.run(&test_run_callback)
84
+
85
+ assert_that(test_run_result_count).equals(2)
86
+ assert_that(test_run_result_count(:pass)).equals(1)
87
+ assert_that(test_run_result_count(:fail)).equals(1)
84
88
 
85
- should "have a fail message with custom and generic explanations" do
86
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to be false."
87
- assert_equal exp, test_run_results(:fail).first.message
89
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to be false."
90
+ assert_that(test_run_results(:fail).first.message).equals(exp)
88
91
  end
89
92
  end
90
93
 
@@ -92,27 +95,28 @@ module Assert::Assertions
92
95
  include Assert::Test::TestHelpers
93
96
 
94
97
  desc "`assert_not_false`"
95
- setup do
96
- desc = @desc = "assert not false fail desc"
97
- args = @args = [false, desc]
98
- @test = Factory.test do
98
+ subject { test1 }
99
+
100
+ let(:desc1) { "assert not false fail desc" }
101
+ let(:args1) { [false, desc1] }
102
+ let(:test1) {
103
+ args = args1
104
+ Factory.test do
99
105
  assert_not_false(true) # pass
100
106
  assert_not_false(*args) # fail
101
107
  end
102
- @c = @test.config
103
- @test.run(&test_run_callback)
104
- end
105
- subject{ @test }
108
+ }
109
+ let(:config1) { test1.config }
106
110
 
107
111
  should "produce results as expected" do
108
- assert_equal 2, test_run_result_count
109
- assert_equal 1, test_run_result_count(:pass)
110
- assert_equal 1, test_run_result_count(:fail)
111
- end
112
+ subject.run(&test_run_callback)
113
+
114
+ assert_that(test_run_result_count).equals(2)
115
+ assert_that(test_run_result_count(:pass)).equals(1)
116
+ assert_that(test_run_result_count(:fail)).equals(1)
112
117
 
113
- should "have a fail message with custom and generic explanations" do
114
- exp = "#{@args[1]}\nExpected #{Assert::U.show(@args[0], @c)} to not be false."
115
- assert_equal exp, test_run_results(:fail).first.message
118
+ exp = "#{args1[1]}\nExpected #{Assert::U.show(args1[0], config1)} to not be false."
119
+ assert_that(test_run_results(:fail).first.message).equals(exp)
116
120
  end
117
121
  end
118
122
  end
@@ -6,12 +6,11 @@ module Assert::Assertions
6
6
  include Assert::Test::TestHelpers
7
7
 
8
8
  desc "Assert::Context"
9
- setup do
10
- @context_class = Factory.modes_off_context_class
11
- @test = Factory.test
12
- @context = @context_class.new(@test, @test.config, proc{ |r| })
13
- end
14
- subject{ @context }
9
+ subject { context1 }
10
+
11
+ let(:context_class1) { Factory.modes_off_context_class }
12
+ let(:test1) { Factory.test }
13
+ let(:context1) { context_class1.new(test1, test1.config, proc { |r| }) }
15
14
 
16
15
  should have_imeths :assert_block, :assert_not_block, :refute_block
17
16
  should have_imeths :assert_raises, :assert_not_raises
@@ -37,21 +36,24 @@ module Assert::Assertions
37
36
  class IgnoredTests < UnitTests
38
37
  desc "ignored assertions helpers"
39
38
  setup do
40
- @tests = Assert::Assertions::IGNORED_ASSERTION_HELPERS.map do |helper|
41
- context_info = Factory.context_info(@context_class)
39
+ tests.each{ |test| test.run(&test_run_callback) }
40
+ end
41
+
42
+ let(:tests) {
43
+ context_info = Factory.context_info(context_class1)
44
+ Assert::Assertions::IGNORED_ASSERTION_HELPERS.map do |helper|
42
45
  Factory.test("ignored assertion helper #{helper}", context_info) do
43
46
  self.send(helper, "doesn't matter")
44
47
  end
45
48
  end
46
- @tests.each{ |test| test.run(&test_run_callback) }
47
- end
49
+ }
48
50
 
49
51
  should "have an ignored result for each helper in the constant" do
50
52
  exp = Assert::Assertions::IGNORED_ASSERTION_HELPERS.size
51
- assert_equal exp, test_run_result_count
53
+ assert_that(test_run_result_count).equals(exp)
52
54
 
53
55
  test_run_results.each do |result|
54
- assert_kind_of Assert::Result::Ignore, result
56
+ assert_that(result).is_kind_of(Assert::Result::Ignore)
55
57
  end
56
58
  end
57
59
 
@@ -60,7 +62,7 @@ module Assert::Assertions
60
62
  "The assertion `#{helper}` is not supported."\
61
63
  " Please use another assertion or the basic `assert`."
62
64
  end
63
- assert_equal exp, test_run_results.collect(&:message)
65
+ assert_that(test_run_results.collect(&:message)).equals(exp)
64
66
  end
65
67
  end
66
68
  end
@@ -6,8 +6,10 @@ 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 { helpers1 }
10
+
11
+ let(:helpers_class1) {
12
+ Class.new do
11
13
  include Assert::ConfigHelpers
12
14
 
13
15
  def config
@@ -16,9 +18,8 @@ module Assert::ConfigHelpers
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
+ let(:helpers1) { helpers_class1.new }
22
23
 
23
24
  should have_imeths :runner, :suite, :view
24
25
  should have_imeths :runner_seed, :single_test?, :single_test_file_line
@@ -34,67 +35,67 @@ module Assert::ConfigHelpers
34
35
  should have_imeths :ocurring_result_types
35
36
 
36
37
  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
38
+ assert_that(subject.runner).equals(subject.config.runner)
39
+ assert_that(subject.suite).equals(subject.config.suite)
40
+ assert_that(subject.view).equals(subject.config.view)
40
41
  end
41
42
 
42
43
  should "know its runner seed" do
43
- assert_equal subject.config.runner_seed, subject.runner_seed
44
+ assert_that(subject.runner_seed).equals(subject.config.runner_seed)
44
45
  end
45
46
 
46
47
  should "know if it is in single test mode" do
47
48
  Assert.stub(subject.config, :single_test?){ true }
48
- assert_true subject.single_test?
49
+ assert_that(subject.single_test?).is_true
49
50
 
50
51
  Assert.stub(subject.config, :single_test?){ false }
51
- assert_false subject.single_test?
52
+ assert_that(subject.single_test?).is_false
52
53
  end
53
54
 
54
55
  should "know its single test file line" do
55
56
  exp = subject.config.single_test_file_line
56
- assert_equal exp, subject.single_test_file_line
57
+ assert_that(subject.single_test_file_line).equals(exp)
57
58
  end
58
59
 
59
60
  should "know its tests-to-run attrs" do
60
61
  exp = subject.config.suite.tests_to_run?
61
- assert_equal exp, subject.tests_to_run?
62
+ assert_that(subject.tests_to_run?).equals(exp)
62
63
 
63
64
  exp = subject.config.suite.tests_to_run_count
64
- assert_equal exp, subject.tests_to_run_count
65
+ assert_that(subject.tests_to_run_count).equals(exp)
65
66
  end
66
67
 
67
68
  should "know its test/result counts" do
68
69
  exp = subject.config.suite.test_count
69
- assert_equal exp, subject.test_count
70
+ assert_that(subject.test_count).equals(exp)
70
71
 
71
72
  exp = subject.config.suite.result_count
72
- assert_equal exp, subject.result_count
73
+ assert_that(subject.result_count).equals(exp)
73
74
 
74
75
  exp = subject.config.suite.pass_result_count
75
- assert_equal exp, subject.pass_result_count
76
+ assert_that(subject.pass_result_count).equals(exp)
76
77
 
77
78
  exp = subject.config.suite.fail_result_count
78
- assert_equal exp, subject.fail_result_count
79
+ assert_that(subject.fail_result_count).equals(exp)
79
80
 
80
81
  exp = subject.config.suite.error_result_count
81
- assert_equal exp, subject.error_result_count
82
+ assert_that(subject.error_result_count).equals(exp)
82
83
 
83
84
  exp = subject.config.suite.skip_result_count
84
- assert_equal exp, subject.skip_result_count
85
+ assert_that(subject.skip_result_count).equals(exp)
85
86
 
86
87
  exp = subject.config.suite.ignore_result_count
87
- assert_equal exp, subject.ignore_result_count
88
+ assert_that(subject.ignore_result_count).equals(exp)
88
89
  end
89
90
 
90
91
  should "know if all tests are passing or not" do
91
92
  result_count = Factory.integer
92
93
  Assert.stub(subject, :result_count){ result_count }
93
94
  Assert.stub(subject, :pass_result_count){ result_count }
94
- assert_true subject.all_pass?
95
+ assert_that(subject.all_pass?).is_true
95
96
 
96
97
  Assert.stub(subject, :pass_result_count){ Factory.integer }
97
- assert_false subject.all_pass?
98
+ assert_that(subject.all_pass?).is_false
98
99
  end
99
100
 
100
101
  should "know its formatted run time, test rate and result rate" do
@@ -102,39 +103,39 @@ module Assert::ConfigHelpers
102
103
 
103
104
  run_time = Factory.float
104
105
  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)
106
+ assert_that(subject.formatted_run_time(run_time, format)).equals(exp)
107
+ assert_that(subject.formatted_run_time(run_time)).equals(exp)
107
108
 
108
109
  test_rate = Factory.float
109
110
  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)
111
+ assert_that(subject.formatted_result_rate(test_rate, format)).equals(exp)
112
+ assert_that(subject.formatted_result_rate(test_rate)).equals(exp)
112
113
 
113
114
  result_rate = Factory.float
114
115
  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)
116
+ assert_that(subject.formatted_result_rate(result_rate, format)).equals(exp)
117
+ assert_that(subject.formatted_result_rate(result_rate)).equals(exp)
117
118
  end
118
119
 
119
120
  should "know its formatted suite run time, test rate and result rate" do
120
121
  format = "%.6f"
121
122
 
122
123
  exp = format % subject.config.suite.run_time
123
- assert_equal exp, subject.formatted_suite_run_time(format)
124
+ assert_that(subject.formatted_suite_run_time(format)).equals(exp)
124
125
 
125
126
  exp = format % subject.config.suite.test_rate
126
- assert_equal exp, subject.formatted_suite_test_rate(format)
127
+ assert_that(subject.formatted_suite_test_rate(format)).equals(exp)
127
128
 
128
129
  exp = format % subject.config.suite.result_rate
129
- assert_equal exp, subject.formatted_suite_result_rate(format)
130
+ assert_that(subject.formatted_suite_result_rate(format)).equals(exp)
130
131
  end
131
132
 
132
133
  should "know whether to show test profile info" do
133
- assert_equal !!subject.config.profile, subject.show_test_profile_info?
134
+ assert_that(subject.show_test_profile_info?).equals(!!subject.config.profile)
134
135
  end
135
136
 
136
137
  should "know whether to show verbose info" do
137
- assert_equal !!subject.config.verbose, subject.show_test_verbose_info?
138
+ assert_that(subject.show_test_verbose_info?).equals(!!subject.config.verbose)
138
139
  end
139
140
 
140
141
  should "know what result types occur in a suite's results" do
@@ -145,7 +146,7 @@ module Assert::ConfigHelpers
145
146
  exp = result_types.select do |type_sym|
146
147
  subject.send("#{type_sym}_result_count") > 0
147
148
  end
148
- assert_equal exp, subject.ocurring_result_types
149
+ assert_that(subject.ocurring_result_types).equals(exp)
149
150
  end
150
151
  end
151
152
  end
@@ -10,10 +10,9 @@ 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 { config1 }
14
+
15
+ let(:config1) { Assert::Config.new }
17
16
 
18
17
  should have_imeths :view, :suite, :runner
19
18
  should have_imeths :test_dir, :test_helper, :test_file_suffixes
@@ -25,73 +24,73 @@ class Assert::Config
25
24
  should have_imeths :single_test_file_line, :single_test_file_path
26
25
 
27
26
  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
27
+ assert_that(subject.view).is_kind_of(Assert::DefaultView)
28
+ assert_that(subject.suite).is_kind_of(Assert::DefaultSuite)
29
+ assert_that(subject.runner).is_kind_of(Assert::DefaultRunner)
31
30
  end
32
31
 
33
32
  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
33
+ assert_that(subject.test_dir).equals("test")
34
+ assert_that(subject.test_helper).equals("helper.rb")
35
+ assert_that(subject.test_file_suffixes).equals(["_tests.rb", "_test.rb"])
37
36
  end
38
37
 
39
38
  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
39
+ assert_that(subject.changed_proc).is_not_nil
40
+ assert_that(subject.pp_proc).is_not_nil
41
+ assert_that(subject.use_diff_proc).is_not_nil
42
+ assert_that(subject.run_diff_proc).is_not_nil
44
43
  end
45
44
 
46
45
  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
46
+ assert_that(subject.runner_seed).is_not_nil
47
+ assert_that(subject.changed_only).is_false
48
+ assert_that(subject.changed_ref).is_empty
49
+ assert_that(subject.single_test).is_empty
50
+ assert_that(subject.pp_objects).is_false
51
+ assert_that(subject.capture_output).is_false
52
+ assert_that(subject.halt_on_fail).is_true
53
+ assert_that(subject.profile).is_false
54
+ assert_that(subject.verbose).is_false
55
+ assert_that(subject.list).is_false
56
+ assert_that(subject.debug).is_false
58
57
  end
59
58
 
60
59
  should "apply settings given from a hash" do
61
60
  assert subject.halt_on_fail
62
61
  subject.apply(:halt_on_fail => false)
63
- assert_not subject.halt_on_fail
62
+ assert_that(subject.halt_on_fail).is_false
64
63
 
65
- assert Assert::Config.new.halt_on_fail
66
- assert_not Assert::Config.new(:halt_on_fail => false).halt_on_fail
64
+ assert_that(Assert::Config.new.halt_on_fail).is_true
65
+ assert_that(Assert::Config.new(:halt_on_fail => false).halt_on_fail).is_false
67
66
  end
68
67
 
69
68
  should "know if it is in single test mode" do
70
- assert_false subject.single_test?
69
+ assert_that(subject.single_test?).is_false
71
70
 
72
71
  subject.apply(:single_test => Factory.string)
73
- assert_true subject.single_test?
72
+ assert_that(subject.single_test?).is_true
74
73
  end
75
74
 
76
75
  should "know its single test file line" do
77
76
  exp = Assert::FileLine.parse(File.expand_path("", Dir.pwd))
78
- assert_equal exp, subject.single_test_file_line
77
+ assert_that(subject.single_test_file_line).equals(exp)
79
78
 
80
79
  file_line_path = "#{Factory.path}_tests.rb:#{Factory.integer}"
81
80
  subject.apply(:single_test => file_line_path)
82
81
 
83
82
  exp = Assert::FileLine.parse(File.expand_path(file_line_path, Dir.pwd))
84
- assert_equal exp, subject.single_test_file_line
83
+ assert_that(subject.single_test_file_line).equals(exp)
85
84
  end
86
85
 
87
86
  should "know its single test file path" do
88
87
  exp = Assert::FileLine.parse(File.expand_path("", Dir.pwd)).file
89
- assert_equal exp, subject.single_test_file_path
88
+ assert_that(subject.single_test_file_path).equals(exp)
90
89
 
91
90
  path = "#{Factory.path}_tests.rb"
92
91
  file_line_path = "#{path}:#{Factory.integer}"
93
92
  subject.apply(:single_test => file_line_path)
94
- assert_equal File.expand_path(path, Dir.pwd), subject.single_test_file_path
93
+ assert_that(subject.single_test_file_path).equals(File.expand_path(path, Dir.pwd))
95
94
  end
96
95
  end
97
96
  end