mocha-macruby 0.9.8.20100129120100 → 0.9.9.20101102121900

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/COPYING.rdoc +3 -0
  2. data/{MIT-LICENSE → MIT-LICENSE.rdoc} +0 -0
  3. data/{README → README.rdoc} +7 -7
  4. data/{RELEASE → RELEASE.rdoc} +18 -0
  5. data/Rakefile +44 -28
  6. data/lib/mocha.rb +1 -0
  7. data/lib/mocha/class_method.rb +1 -3
  8. data/lib/mocha/expectation.rb +37 -34
  9. data/lib/mocha/integration/mini_test.rb +32 -4
  10. data/lib/mocha/integration/mini_test/exception_translation.rb +20 -0
  11. data/lib/mocha/integration/mini_test/{version_131_and_above.rb → version_13.rb} +7 -13
  12. data/lib/mocha/integration/mini_test/version_140.rb +52 -0
  13. data/lib/mocha/integration/mini_test/version_141.rb +56 -0
  14. data/lib/mocha/integration/mini_test/version_142_and_above.rb +47 -0
  15. data/lib/mocha/integration/test_unit.rb +23 -8
  16. data/lib/mocha/integration/test_unit/gem_version_200.rb +3 -0
  17. data/lib/mocha/integration/test_unit/{gem_version_201_and_above.rb → gem_version_201_to_202.rb} +4 -1
  18. data/lib/mocha/integration/test_unit/gem_version_203_to_209.rb +52 -0
  19. data/lib/mocha/integration/test_unit/ruby_version_185_and_below.rb +3 -0
  20. data/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb +3 -0
  21. data/lib/mocha/mock.rb +33 -18
  22. data/lib/mocha/module_method.rb +1 -1
  23. data/lib/mocha/object.rb +144 -160
  24. data/lib/mocha/options.rb +1 -0
  25. data/lib/mocha/parameter_matchers/base.rb +50 -2
  26. data/test/acceptance/acceptance_test_helper.rb +1 -1
  27. data/test/acceptance/api_test.rb +1 -1
  28. data/test/acceptance/bug_18914_test.rb +1 -1
  29. data/test/acceptance/bug_21465_test.rb +1 -1
  30. data/test/acceptance/bug_21563_test.rb +1 -1
  31. data/test/acceptance/expected_invocation_count_test.rb +1 -1
  32. data/test/acceptance/failure_messages_test.rb +1 -1
  33. data/test/acceptance/minitest_test.rb +128 -124
  34. data/test/acceptance/mocha_example_test.rb +1 -1
  35. data/test/acceptance/mocha_test_result_test.rb +1 -1
  36. data/test/acceptance/mock_test.rb +1 -1
  37. data/test/acceptance/mock_with_initializer_block_test.rb +1 -1
  38. data/test/acceptance/mocked_methods_dispatch_test.rb +1 -1
  39. data/test/acceptance/optional_parameters_test.rb +1 -1
  40. data/test/acceptance/parameter_matcher_test.rb +38 -1
  41. data/test/acceptance/partial_mocks_test.rb +1 -1
  42. data/test/acceptance/return_value_test.rb +1 -1
  43. data/test/acceptance/sequence_test.rb +1 -1
  44. data/test/acceptance/states_test.rb +1 -1
  45. data/test/acceptance/stub_any_instance_method_test.rb +5 -2
  46. data/test/acceptance/stub_class_method_test.rb +5 -2
  47. data/test/acceptance/stub_everything_test.rb +1 -1
  48. data/test/acceptance/stub_instance_method_test.rb +5 -2
  49. data/test/acceptance/stub_module_method_test.rb +3 -3
  50. data/test/acceptance/stub_test.rb +1 -1
  51. data/test/acceptance/stubba_example_test.rb +1 -1
  52. data/test/acceptance/stubba_test.rb +1 -1
  53. data/test/acceptance/stubba_test_result_test.rb +1 -1
  54. data/test/acceptance/stubbing_error_backtrace_test.rb +1 -1
  55. data/test/acceptance/stubbing_method_unnecessarily_test.rb +1 -1
  56. data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +5 -5
  57. data/test/acceptance/stubbing_non_existent_class_method_test.rb +5 -5
  58. data/test/acceptance/stubbing_non_existent_instance_method_test.rb +5 -5
  59. data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +9 -9
  60. data/test/acceptance/stubbing_non_public_class_method_test.rb +9 -9
  61. data/test/acceptance/stubbing_non_public_instance_method_test.rb +9 -9
  62. data/test/acceptance/stubbing_on_non_mock_object_test.rb +5 -5
  63. data/test/mini_test_result.rb +74 -0
  64. data/test/test_helper.rb +3 -1
  65. data/test/test_runner.rb +25 -11
  66. data/test/unit/any_instance_method_test.rb +1 -1
  67. data/test/unit/array_inspect_test.rb +1 -1
  68. data/test/unit/backtrace_filter_test.rb +1 -1
  69. data/test/unit/cardinality_test.rb +1 -1
  70. data/test/unit/central_test.rb +1 -1
  71. data/test/unit/change_state_side_effect_test.rb +1 -1
  72. data/test/unit/class_method_test.rb +2 -2
  73. data/test/unit/configuration_test.rb +1 -1
  74. data/test/unit/date_time_inspect_test.rb +1 -1
  75. data/test/unit/exception_raiser_test.rb +1 -1
  76. data/test/unit/expectation_list_test.rb +1 -1
  77. data/test/unit/expectation_test.rb +1 -1
  78. data/test/unit/hash_inspect_test.rb +1 -1
  79. data/test/unit/in_state_ordering_constraint_test.rb +1 -1
  80. data/test/unit/metaclass_test.rb +1 -1
  81. data/test/unit/method_matcher_test.rb +1 -1
  82. data/test/unit/mock_test.rb +16 -14
  83. data/test/unit/mockery_test.rb +1 -1
  84. data/test/unit/multiple_yields_test.rb +1 -1
  85. data/test/unit/no_yields_test.rb +1 -1
  86. data/test/unit/object_inspect_test.rb +10 -9
  87. data/test/unit/object_test.rb +11 -10
  88. data/test/unit/parameter_matchers/all_of_test.rb +1 -1
  89. data/test/unit/parameter_matchers/any_of_test.rb +1 -1
  90. data/test/unit/parameter_matchers/anything_test.rb +1 -1
  91. data/test/unit/parameter_matchers/equals_test.rb +1 -1
  92. data/test/unit/parameter_matchers/has_entries_test.rb +1 -1
  93. data/test/unit/parameter_matchers/has_entry_test.rb +1 -1
  94. data/test/unit/parameter_matchers/has_key_test.rb +1 -1
  95. data/test/unit/parameter_matchers/has_value_test.rb +1 -1
  96. data/test/unit/parameter_matchers/includes_test.rb +5 -5
  97. data/test/unit/parameter_matchers/instance_of_test.rb +2 -2
  98. data/test/unit/parameter_matchers/is_a_test.rb +1 -1
  99. data/test/unit/parameter_matchers/kind_of_test.rb +1 -1
  100. data/test/unit/parameter_matchers/not_test.rb +1 -1
  101. data/test/unit/parameter_matchers/regexp_matches_test.rb +1 -1
  102. data/test/unit/parameter_matchers/responds_with_test.rb +1 -1
  103. data/test/unit/parameter_matchers/yaml_equivalent_test.rb +1 -1
  104. data/test/unit/parameters_matcher_test.rb +1 -1
  105. data/test/unit/return_values_test.rb +1 -1
  106. data/test/unit/sequence_test.rb +1 -1
  107. data/test/unit/single_return_value_test.rb +1 -1
  108. data/test/unit/single_yield_test.rb +1 -1
  109. data/test/unit/state_machine_test.rb +1 -1
  110. data/test/unit/string_inspect_test.rb +1 -1
  111. data/test/unit/yield_parameters_test.rb +1 -1
  112. metadata +43 -19
  113. data/COPYING +0 -3
@@ -0,0 +1,74 @@
1
+ require 'stringio'
2
+ require 'test/unit/testcase'
3
+ require 'minitest/unit'
4
+
5
+ class MiniTestResult
6
+ def self.parse_failure(raw)
7
+ matches = %r{(Failure)\:\n([^\(]+)\(([^\)]+)\) \[([^\]]+)\]\:\n(.*)\n}m.match(raw)
8
+ return nil unless matches
9
+ Failure.new(matches[2], matches[3], [matches[4]], matches[5])
10
+ end
11
+
12
+ def self.parse_error(raw)
13
+ matches = %r{(Error)\:\n([^\(]+)\(([^\)]+)\)\:\n(.+?)\n.+ (.*)\n}m.match(raw)
14
+ return nil unless matches
15
+ Error.new(matches[2], matches[3], matches[4], [matches[5]])
16
+ end
17
+
18
+ class Failure
19
+ attr_reader :method, :test_case, :location, :message
20
+ def initialize(method, test_case, location, message)
21
+ @method, @test_case, @location, @message = method, test_case, location, message
22
+ end
23
+ end
24
+
25
+ class Error
26
+ class Exception
27
+ attr_reader :message, :backtrace
28
+ def initialize(message, location)
29
+ @message, @backtrace = message, location
30
+ end
31
+ end
32
+
33
+ attr_reader :method, :test_case, :exception
34
+ def initialize(method, test_case, message, backtrace)
35
+ @method, @test_case, @exception = method, test_case, Exception.new(message, backtrace)
36
+ end
37
+ end
38
+
39
+ def initialize(runner, test)
40
+ @runner, @test = runner, test
41
+ end
42
+
43
+ def failure_count
44
+ @runner.failures
45
+ end
46
+
47
+ def assertion_count
48
+ @test._assertions
49
+ end
50
+
51
+ def error_count
52
+ @runner.errors
53
+ end
54
+
55
+ def passed?
56
+ @test.passed?
57
+ end
58
+
59
+ def failures
60
+ @runner.report.map { |puked| MiniTestResult.parse_failure(puked) }.compact
61
+ end
62
+
63
+ def errors
64
+ @runner.report.map { |puked| MiniTestResult.parse_error(puked) }.compact
65
+ end
66
+
67
+ def failure_messages
68
+ failures.map(&:message)
69
+ end
70
+
71
+ def error_messages
72
+ errors.map { |e| e.exception.message }
73
+ end
74
+ end
data/test/test_helper.rb CHANGED
@@ -8,7 +8,9 @@ $:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'unit'))
8
8
  $:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'unit', 'parameter_matchers'))
9
9
  $:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'acceptance'))
10
10
 
11
- if ENV['MOCHA_OPTIONS'] == 'use_test_unit_gem'
11
+ require 'mocha/options'
12
+ if $options['use_test_unit_gem']
13
+ require 'rubygems'
12
14
  gem 'test-unit'
13
15
  end
14
16
 
data/test/test_runner.rb CHANGED
@@ -1,23 +1,37 @@
1
- require 'test/unit/testresult'
2
1
  require 'test/unit/testcase'
3
2
 
3
+ if defined?(MiniTest)
4
+ require 'mocha/integration/mini_test'
5
+ require File.expand_path('../mini_test_result', __FILE__)
6
+ else
7
+ require 'test/unit/testresult'
8
+ end
9
+
4
10
  module TestRunner
5
-
6
- def run_as_test(test_result = Test::Unit::TestResult.new, &block)
11
+ def run_as_test(test_result = nil, &block)
7
12
  test_class = Class.new(Test::Unit::TestCase) do
8
13
  define_method(:test_me, &block)
9
14
  end
10
15
  test = test_class.new(:test_me)
11
- test.run(test_result) {}
12
- class << test_result
13
- attr_reader :failures, :errors
14
- def failure_messages
15
- failures.map { |failure| failure.message }
16
- end
17
- def error_messages
18
- errors.map { |error| error.message }
16
+
17
+ if defined?(Test::Unit::TestResult)
18
+ test_result ||= Test::Unit::TestResult.new
19
+ test.run(test_result) {}
20
+ class << test_result
21
+ attr_reader :failures, :errors
22
+ def failure_messages
23
+ failures.map { |failure| failure.message }
24
+ end
25
+ def error_messages
26
+ errors.map { |error| error.message }
27
+ end
19
28
  end
29
+ else
30
+ runner = MiniTest::Unit.new
31
+ test.run(runner)
32
+ test_result = MiniTestResult.new(runner, test)
20
33
  end
34
+
21
35
  test_result
22
36
  end
23
37
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'method_definer'
3
3
  require 'mocha/mock'
4
4
  require 'mocha/any_instance_method'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/inspect'
3
3
 
4
4
  class ArrayInspectTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/backtrace_filter'
3
3
 
4
4
  class BacktraceFilterTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/cardinality'
3
3
 
4
4
  class CardinalityTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/central'
4
4
  require 'mocha/mock'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/change_state_side_effect'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'method_definer'
3
3
  require 'mocha/mock'
4
4
 
@@ -292,4 +292,4 @@ if on_macruby?
292
292
  end
293
293
 
294
294
  end
295
- end
295
+ end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require "mocha/configuration"
3
3
 
4
4
  class ConfigurationTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/inspect'
3
3
 
4
4
  class DateTimeInspectTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/exception_raiser'
4
4
  require 'timeout'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/expectation_list'
3
3
  require 'mocha/expectation'
4
4
  require 'set'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'method_definer'
3
3
  require 'mocha/expectation'
4
4
  require 'mocha/sequence'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/inspect'
3
3
 
4
4
  class HashInspectTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/in_state_ordering_constraint'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/metaclass'
3
3
 
4
4
  class MetaclassTest < Test::Unit::TestCase
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/method_matcher'
3
3
 
4
4
  class MethodMatcherTest < Test::Unit::TestCase
@@ -1,5 +1,5 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
2
- require 'mocha/mock'
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+ require 'mocha/mockery' # requires 'mock'
3
3
  require 'mocha/expectation_error'
4
4
  require 'set'
5
5
  require 'simple_counter'
@@ -50,18 +50,20 @@ class MockTest < Test::Unit::TestCase
50
50
  OBJECT_METHODS = STANDARD_OBJECT_PUBLIC_INSTANCE_METHODS.reject { |m| m =~ /^__.*__$/ || m == :object_id }
51
51
  end
52
52
 
53
- def test_should_be_able_to_mock_standard_object_methods
54
- mock = Mock.new
55
- OBJECT_METHODS.each { |method| mock.__expects__(method.to_sym).returns(method) }
56
- OBJECT_METHODS.each { |method| assert_equal method, mock.__send__(method.to_sym) }
57
- assert mock.__verified__?
58
- end
53
+ # MacRuby bug: https://www.macruby.org/trac/ticket/716
54
+ # def test_should_be_able_to_mock_standard_object_methods
55
+ # mock = Mock.new
56
+ # OBJECT_METHODS.each { |method| mock.__expects__(method.to_sym).returns(method) }
57
+ # OBJECT_METHODS.each { |method| assert_equal method, mock.__send__(method.to_sym) }
58
+ # assert mock.__verified__?
59
+ # end
59
60
 
60
- def test_should_be_able_to_stub_standard_object_methods
61
- mock = Mock.new
62
- OBJECT_METHODS.each { |method| mock.__stubs__(method.to_sym).returns(method) }
63
- OBJECT_METHODS.each { |method| assert_equal method, mock.__send__(method.to_sym) }
64
- end
61
+ # MacRuby bug: https://www.macruby.org/trac/ticket/716
62
+ # def test_should_be_able_to_stub_standard_object_methods
63
+ # mock = Mock.new
64
+ # OBJECT_METHODS.each { |method| mock.__stubs__(method.to_sym).returns(method) }
65
+ # OBJECT_METHODS.each { |method| assert_equal method, mock.__send__(method.to_sym) }
66
+ # end
65
67
 
66
68
  def test_should_create_and_add_expectations
67
69
  mock = Mock.new
@@ -299,4 +301,4 @@ class MockTest < Test::Unit::TestCase
299
301
  assert mock.respond_to?(:xyz)
300
302
  end
301
303
 
302
- end
304
+ end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/mockery'
3
3
  require 'mocha/state_machine'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/multiple_yields'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/no_yields'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/inspect'
3
3
  require 'method_definer'
4
4
 
@@ -10,7 +10,7 @@ class ObjectInspectTest < Test::Unit::TestCase
10
10
  attr_accessor :attribute
11
11
  end
12
12
  object.attribute = 'instance_variable'
13
- assert_match Regexp.new("^#<Object:0x[0-9A-Fa-f]{1,8}.*>$"), object.mocha_inspect
13
+ assert_match Regexp.new("^#<#{object.class}:0x[0-9A-Fa-f]{1,8}.*>$"), object.mocha_inspect
14
14
  assert_no_match(/instance_variable/, object.mocha_inspect)
15
15
  end
16
16
 
@@ -23,15 +23,16 @@ class ObjectInspectTest < Test::Unit::TestCase
23
23
  end
24
24
 
25
25
  def test_should_use_underscored_id_instead_of_object_id_or_id_so_that_they_can_be_stubbed
26
+ calls = []
26
27
  object = Object.new
27
- object.define_instance_accessor(:called)
28
- object.called = false
29
- object.replace_instance_method(:object_id) { self.called = true; 1 }
30
- if RUBY_VERSION < '1.9'
31
- object.replace_instance_method(:id) { self.called = true; 1 }
32
- end
28
+ object.replace_instance_method(:id) { calls << :id; return 1 } if RUBY_VERSION < '1.9'
29
+ object.replace_instance_method(:object_id) { calls << :object_id; return 1 }
30
+ object.replace_instance_method(:__id__) { calls << :__id__; return 1 }
31
+ object.replace_instance_method(:inspect) { "object-description" }
32
+
33
33
  object.mocha_inspect
34
- assert_equal false, object.called
34
+
35
+ assert_equal [:__id__], calls.uniq
35
36
  end
36
37
 
37
38
  end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "test_helper")
1
+ require File.expand_path('../../test_helper', __FILE__)
2
2
  require 'mocha/object'
3
3
  require 'mocha/mockery'
4
4
  require 'mocha/mock'
@@ -7,7 +7,7 @@ require 'method_definer'
7
7
  class ObjectTest < Test::Unit::TestCase
8
8
 
9
9
  include Mocha
10
-
10
+
11
11
  def test_should_build_mocha_referring_to_self
12
12
  instance = Object.new
13
13
  mocha = instance.mocha
@@ -45,11 +45,12 @@ class ObjectTest < Test::Unit::TestCase
45
45
  def test_should_use_stubba_instance_method_for_object
46
46
  assert_equal Mocha::InstanceMethod, Object.new.stubba_method
47
47
  end
48
-
49
- def test_should_use_stubba_module_method_for_module
50
- assert_equal Mocha::ModuleMethod, Module.new.stubba_method
51
- end
52
-
48
+
49
+ # MacRuby bug https://www.macruby.org/trac/ticket/718
50
+ # def test_should_use_stubba_module_method_for_module
51
+ # assert_equal Mocha::ModuleMethod, Module.new.stubba_method
52
+ # end
53
+
53
54
  def test_should_use_stubba_class_method_for_class
54
55
  assert_equal Mocha::ClassMethod, Class.new.stubba_method
55
56
  end
@@ -62,17 +63,17 @@ class ObjectTest < Test::Unit::TestCase
62
63
  object = Object.new
63
64
  assert_equal object, object.stubba_object
64
65
  end
65
-
66
+
66
67
  def test_should_stub_self_for_module
67
68
  mod = Module.new
68
69
  assert_equal mod, mod.stubba_object
69
70
  end
70
-
71
+
71
72
  def test_should_stub_self_for_class
72
73
  klass = Class.new
73
74
  assert_equal klass, klass.stubba_object
74
75
  end
75
-
76
+
76
77
  def test_should_stub_relevant_class_for_any_instance
77
78
  klass = Class.new
78
79
  any_instance = Class::AnyInstance.new(klass)
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
1
+ require File.expand_path('../../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/parameter_matchers/all_of'
4
4
  require 'mocha/inspect'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
1
+ require File.expand_path('../../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/parameter_matchers/any_of'
4
4
  require 'mocha/inspect'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
1
+ require File.expand_path('../../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/parameter_matchers/anything'
4
4
  require 'mocha/inspect'
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "..", "test_helper")
1
+ require File.expand_path('../../../test_helper', __FILE__)
2
2
 
3
3
  require 'mocha/parameter_matchers/equals'
4
4
  require 'mocha/inspect'