mocha 0.12.8 → 0.12.9
Sign up to get free protection for your applications and to get access to all the features.
- data/RELEASE.rdoc +3 -0
- data/lib/mocha/integration/mini_test.rb +3 -0
- data/lib/mocha/integration/mini_test/version_450.rb +72 -0
- data/lib/mocha/integration/test_unit.rb +3 -3
- data/lib/mocha/integration/test_unit/{gem_version_230_to_253.rb → gem_version_230_to_254.rb} +2 -2
- data/lib/mocha/version.rb +1 -1
- metadata +12 -11
data/RELEASE.rdoc
CHANGED
@@ -16,6 +16,7 @@ if !MiniTest::Unit::TestCase.ancestors.include?(Mocha::API)
|
|
16
16
|
require 'mocha/integration/mini_test/version_330_to_410'
|
17
17
|
require 'mocha/integration/mini_test/version_420_to_433'
|
18
18
|
require 'mocha/integration/mini_test/version_440'
|
19
|
+
require 'mocha/integration/mini_test/version_450'
|
19
20
|
|
20
21
|
module MiniTest
|
21
22
|
class Unit
|
@@ -58,6 +59,8 @@ if !MiniTest::Unit::TestCase.ancestors.include?(Mocha::API)
|
|
58
59
|
include Mocha::Integration::MiniTest::Version420To433
|
59
60
|
elsif Gem::Requirement.new('>= 4.4.0', '<= 4.4.0').satisfied_by?(mini_test_version)
|
60
61
|
include Mocha::Integration::MiniTest::Version440
|
62
|
+
elsif Gem::Requirement.new('>= 4.5.0', '<= 4.5.0').satisfied_by?(mini_test_version)
|
63
|
+
include Mocha::Integration::MiniTest::Version450
|
61
64
|
else
|
62
65
|
raise "No Mocha monkey-patch for MiniTest version"
|
63
66
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'mocha/integration/mini_test/assertion_counter'
|
2
|
+
require 'mocha/expectation_error'
|
3
|
+
|
4
|
+
module Mocha
|
5
|
+
|
6
|
+
module Integration
|
7
|
+
|
8
|
+
module MiniTest
|
9
|
+
|
10
|
+
module Version450
|
11
|
+
def self.included(mod)
|
12
|
+
$stderr.puts "Monkey patching MiniTest >= v4.5.0 <= v4.5.0" if $mocha_options['debug']
|
13
|
+
end
|
14
|
+
def run runner
|
15
|
+
trap "INFO" do
|
16
|
+
runner.report.each_with_index do |msg, i|
|
17
|
+
warn "\n%3d) %s" % [i + 1, msg]
|
18
|
+
end
|
19
|
+
warn ''
|
20
|
+
time = runner.start_time ? Time.now - runner.start_time : 0
|
21
|
+
warn "Current Test: %s#%s %.2fs" % [self.class, self.__name__, time]
|
22
|
+
runner.status $stderr
|
23
|
+
end if ::MiniTest::Unit::TestCase::SUPPORTS_INFO_SIGNAL
|
24
|
+
start_time = Time.now
|
25
|
+
assertion_counter = AssertionCounter.new(self)
|
26
|
+
result = ""
|
27
|
+
begin
|
28
|
+
begin
|
29
|
+
@passed = nil
|
30
|
+
self.before_setup
|
31
|
+
self.setup
|
32
|
+
self.after_setup
|
33
|
+
self.run_test self.__name__
|
34
|
+
mocha_verify(assertion_counter)
|
35
|
+
result = "." unless io?
|
36
|
+
time = Time.now - start_time
|
37
|
+
runner.record self.class, self.__name__, self._assertions, time, nil
|
38
|
+
@passed = true
|
39
|
+
rescue *::MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS
|
40
|
+
raise
|
41
|
+
rescue Exception => e
|
42
|
+
@passed = ::MiniTest::Skip === e
|
43
|
+
time = Time.now - start_time
|
44
|
+
runner.record self.class, self.__name__, self._assertions, time, e
|
45
|
+
result = runner.puke self.class, self.__name__, Mocha::Integration::MiniTest.translate(e)
|
46
|
+
ensure
|
47
|
+
%w{ before_teardown teardown after_teardown }.each do |hook|
|
48
|
+
begin
|
49
|
+
self.send hook
|
50
|
+
rescue *::MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS
|
51
|
+
raise
|
52
|
+
rescue Exception => e
|
53
|
+
@passed = false
|
54
|
+
translated_exception = Mocha::Integration::MiniTest.translate(e)
|
55
|
+
runner.record self.class, self.__name__, self._assertions, time, translated_exception
|
56
|
+
result = runner.puke self.class, self.__name__, translated_exception
|
57
|
+
end
|
58
|
+
end
|
59
|
+
trap 'INFO', 'DEFAULT' if ::MiniTest::Unit::TestCase::SUPPORTS_INFO_SIGNAL
|
60
|
+
end
|
61
|
+
ensure
|
62
|
+
mocha_teardown
|
63
|
+
end
|
64
|
+
result
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
@@ -6,7 +6,7 @@ if !Test::Unit::TestCase.ancestors.include?(Mocha::API)
|
|
6
6
|
require 'mocha/integration/test_unit/gem_version_200'
|
7
7
|
require 'mocha/integration/test_unit/gem_version_201_to_202'
|
8
8
|
require 'mocha/integration/test_unit/gem_version_203_to_220'
|
9
|
-
require 'mocha/integration/test_unit/
|
9
|
+
require 'mocha/integration/test_unit/gem_version_230_to_254'
|
10
10
|
require 'mocha/integration/test_unit/ruby_version_185_and_below'
|
11
11
|
require 'mocha/integration/test_unit/ruby_version_186_and_above'
|
12
12
|
|
@@ -43,8 +43,8 @@ if !Test::Unit::TestCase.ancestors.include?(Mocha::API)
|
|
43
43
|
include Mocha::Integration::TestUnit::GemVersion201To202
|
44
44
|
elsif Gem::Requirement.new('>= 2.0.3', '<= 2.2.0').satisfied_by?(test_unit_version)
|
45
45
|
include Mocha::Integration::TestUnit::GemVersion203To220
|
46
|
-
elsif Gem::Requirement.new('>= 2.3.0', '<= 2.5.
|
47
|
-
include Mocha::Integration::TestUnit::
|
46
|
+
elsif Gem::Requirement.new('>= 2.3.0', '<= 2.5.4').satisfied_by?(test_unit_version)
|
47
|
+
include Mocha::Integration::TestUnit::GemVersion230To254
|
48
48
|
else
|
49
49
|
raise "No Mocha monkey-patch for Test::Unit version"
|
50
50
|
end
|
data/lib/mocha/integration/test_unit/{gem_version_230_to_253.rb → gem_version_230_to_254.rb}
RENAMED
@@ -8,9 +8,9 @@ module Mocha
|
|
8
8
|
|
9
9
|
module TestUnit
|
10
10
|
|
11
|
-
module
|
11
|
+
module GemVersion230To254
|
12
12
|
def self.included(mod)
|
13
|
-
$stderr.puts "Monkey patching Test::Unit gem >= v2.3.0 and <= v2.5.
|
13
|
+
$stderr.puts "Monkey patching Test::Unit gem >= v2.3.0 and <= v2.5.4" if $mocha_options['debug']
|
14
14
|
end
|
15
15
|
def run(result)
|
16
16
|
assertion_counter = AssertionCounter.new(result)
|
data/lib/mocha/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mocha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.8
|
5
4
|
prerelease:
|
5
|
+
version: 0.12.9
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Mead
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: metaclass
|
@@ -20,13 +20,13 @@ dependencies:
|
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 0.0.1
|
22
22
|
type: :runtime
|
23
|
-
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
version: 0.0.1
|
29
|
+
prerelease: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rake
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -36,13 +36,13 @@ dependencies:
|
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
type: :development
|
39
|
-
prerelease: false
|
40
39
|
version_requirements: !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
41
|
requirements:
|
43
42
|
- - ! '>='
|
44
43
|
- !ruby/object:Gem::Version
|
45
44
|
version: '0'
|
45
|
+
prerelease: false
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: introspection
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,13 +52,13 @@ dependencies:
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 0.0.1
|
54
54
|
type: :development
|
55
|
-
prerelease: false
|
56
55
|
version_requirements: !ruby/object:Gem::Requirement
|
57
56
|
none: false
|
58
57
|
requirements:
|
59
58
|
- - ~>
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 0.0.1
|
61
|
+
prerelease: false
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: yard
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,13 +68,13 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
type: :development
|
71
|
-
prerelease: false
|
72
71
|
version_requirements: !ruby/object:Gem::Requirement
|
73
72
|
none: false
|
74
73
|
requirements:
|
75
74
|
- - ! '>='
|
76
75
|
- !ruby/object:Gem::Version
|
77
76
|
version: '0'
|
77
|
+
prerelease: false
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rdoc
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,13 +84,13 @@ dependencies:
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
type: :development
|
87
|
-
prerelease: false
|
88
87
|
version_requirements: !ruby/object:Gem::Requirement
|
89
88
|
none: false
|
90
89
|
requirements:
|
91
90
|
- - ! '>='
|
92
91
|
- !ruby/object:Gem::Version
|
93
92
|
version: '0'
|
93
|
+
prerelease: false
|
94
94
|
description: Mocking and stubbing library with JMock/SchMock syntax, which allows
|
95
95
|
mocking and stubbing of methods on real (non-mock) classes.
|
96
96
|
email: mocha-developer@googlegroups.com
|
@@ -163,12 +163,13 @@ files:
|
|
163
163
|
- lib/mocha/integration/mini_test/version_330_to_410.rb
|
164
164
|
- lib/mocha/integration/mini_test/version_420_to_433.rb
|
165
165
|
- lib/mocha/integration/mini_test/version_440.rb
|
166
|
+
- lib/mocha/integration/mini_test/version_450.rb
|
166
167
|
- lib/mocha/integration/test_unit.rb
|
167
168
|
- lib/mocha/integration/test_unit/assertion_counter.rb
|
168
169
|
- lib/mocha/integration/test_unit/gem_version_200.rb
|
169
170
|
- lib/mocha/integration/test_unit/gem_version_201_to_202.rb
|
170
171
|
- lib/mocha/integration/test_unit/gem_version_203_to_220.rb
|
171
|
-
- lib/mocha/integration/test_unit/
|
172
|
+
- lib/mocha/integration/test_unit/gem_version_230_to_254.rb
|
172
173
|
- lib/mocha/integration/test_unit/ruby_version_185_and_below.rb
|
173
174
|
- lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
|
174
175
|
- lib/mocha/is_a.rb
|
@@ -348,10 +349,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
348
349
|
requirements:
|
349
350
|
- - ! '>='
|
350
351
|
- !ruby/object:Gem::Version
|
351
|
-
version: '0'
|
352
352
|
segments:
|
353
353
|
- 0
|
354
|
-
hash: -
|
354
|
+
hash: -3342942557136973599
|
355
|
+
version: '0'
|
355
356
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
356
357
|
none: false
|
357
358
|
requirements:
|
@@ -360,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
360
361
|
version: '0'
|
361
362
|
requirements: []
|
362
363
|
rubyforge_project: mocha
|
363
|
-
rubygems_version: 1.8.
|
364
|
+
rubygems_version: 1.8.23
|
364
365
|
signing_key:
|
365
366
|
specification_version: 3
|
366
367
|
summary: Mocking and stubbing library
|