mocha 0.13.1 → 0.13.2
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.
- data/.yardopts +1 -0
- data/README.md +58 -5
- data/RELEASE.md +9 -0
- data/Rakefile +7 -1
- data/lib/mocha/class_method.rb +10 -7
- data/lib/mocha/expectation.rb +7 -0
- data/lib/mocha/expectation_error_factory.rb +1 -1
- data/lib/mocha/mock.rb +33 -1
- data/lib/mocha/version.rb +1 -1
- data/test/acceptance/unstubbing_test.rb +17 -0
- data/test/unit/expectation_test.rb +17 -0
- data/test/unit/mock_test.rb +31 -8
- data/test/unit/mockery_test.rb +3 -2
- data/test/unit/object_methods_test.rb +2 -1
- data/yard-templates/default/layout/html/google_analytics.erb +11 -0
- data/yard-templates/default/layout/html/setup.rb +6 -0
- metadata +85 -92
data/.yardopts
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
## Mocha [](https://secure.travis-ci.org/freerange/mocha)
|
1
|
+
## Mocha [](https://secure.travis-ci.org/freerange/mocha) [](http://badge.fury.io/rb/mocha)
|
2
2
|
|
3
3
|
### Description
|
4
4
|
|
@@ -15,7 +15,7 @@ Install the latest version of the gem with the following command...
|
|
15
15
|
|
16
16
|
$ gem install mocha
|
17
17
|
|
18
|
-
Note
|
18
|
+
Note: If you are intending to use Mocha with Test::Unit or MiniTest, you should only load Mocha *after* loading the relevant test library...
|
19
19
|
|
20
20
|
require "test/unit"
|
21
21
|
require "mocha/setup"
|
@@ -41,18 +41,71 @@ If you're loading Mocha using Bundler within a Rails application, you should ens
|
|
41
41
|
# At bottom of test_helper.rb
|
42
42
|
require "mocha/setup"
|
43
43
|
|
44
|
+
Note: Using the latest version of Mocha (0.13.1) with the latest versions of Rails (e.g. 3.2.11, 3.1.10, or 3.0.19), you will see the following Mocha deprecation warning:
|
45
|
+
|
46
|
+
*** Mocha deprecation warning: Change `require 'mocha'` to `require 'mocha/setup'`.
|
47
|
+
|
48
|
+
This will happen until new versions of Rails are released incorporating the following pull requests:
|
49
|
+
|
50
|
+
* 3-2-stable - https://github.com/rails/rails/pull/8200
|
51
|
+
* 3-1-stable - https://github.com/rails/rails/pull/8871
|
52
|
+
* 3-0-stable - https://github.com/rails/rails/pull/8872
|
53
|
+
|
54
|
+
The deprecation warning will not cause any problems, but if you don't like seeing then you could do one of the following:
|
55
|
+
|
56
|
+
##### Option 1 - Disable Mocha deprecation warnings with a Rails initializer
|
57
|
+
|
58
|
+
# config/mocha.rb
|
59
|
+
if Rails.env.test? || Rails.env.development?
|
60
|
+
require "mocha/version"
|
61
|
+
require "mocha/deprecation"
|
62
|
+
if Mocha::VERSION == "0.13.2" && Rails::VERSION::STRING == "3.2.11"
|
63
|
+
Mocha::Deprecation.mode = :disabled
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
Note 1: I have intentionally made this brittle against patch releases of Mocha and Rails, because this way you are more likely to notice when you no longer need the initializer.
|
68
|
+
Note 2: This will not work with recent versions of the Test::Unit gem (see below).
|
69
|
+
|
70
|
+
##### Option 2 - Use "edge" Rails or one of the relevant "stable" branches of Rails
|
71
|
+
|
72
|
+
# Gemfile
|
73
|
+
gem "rails", git: "git://github.com/rails/rails.git", branch: "3-2-stable"
|
74
|
+
group :test do
|
75
|
+
gem "mocha", :require => false
|
76
|
+
end
|
77
|
+
|
78
|
+
# test/test_helper.rb
|
79
|
+
require "mocha/setup"
|
80
|
+
|
81
|
+
##### Option 3 - Downgrade to Mocha 0.12.8
|
82
|
+
|
83
|
+
# Gemfile in Rails app
|
84
|
+
gem "mocha", "~> 0.12.8", :require => false
|
85
|
+
|
86
|
+
# At bottom of test_helper.rb
|
87
|
+
require "mocha"
|
88
|
+
|
89
|
+
Note: This isn't as bad as it sounds, because there aren't many changes in Mocha 0.13.x that are not in 0.12.x.
|
90
|
+
|
91
|
+
#### Rails with Test::Unit
|
92
|
+
|
93
|
+
Unfortunately due to Rails relying on Mocha & Test::Unit internals, there is a problem with using recent released versions of Rails with the latest version of Mocha and recent versions of the Test::Unit gem.
|
94
|
+
|
95
|
+
In this case you will have to use either Option 2 or Option 3 (see above). Option 1 will not work.
|
96
|
+
|
44
97
|
#### Rails Plugin
|
45
98
|
|
46
99
|
Install the Rails plugin...
|
47
100
|
|
48
101
|
$ rails plugin install git://github.com/freerange/mocha.git
|
49
102
|
|
50
|
-
Note
|
103
|
+
Note: As of version 0.9.8, the Mocha plugin is not automatically loaded at plugin load time. Instead it must be manually loaded e.g. at the bottom of your `test_helper.rb`.
|
51
104
|
|
52
105
|
#### Know Issues
|
53
106
|
|
54
|
-
* Versions 0.10.2, 0.10.3 & 0.11.0 of the gem were broken.
|
55
|
-
* Versions 0.9.6 & 0.9.7 of the Rails plugin were broken.
|
107
|
+
* Versions 0.10.2, 0.10.3 & 0.11.0 of the Mocha gem were broken.
|
108
|
+
* Versions 0.9.6 & 0.9.7 of the Mocha Rails plugin were broken.
|
56
109
|
* Please do not use these versions.
|
57
110
|
|
58
111
|
### Usage
|
data/RELEASE.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Release Notes
|
2
2
|
|
3
|
+
## 0.13.2
|
4
|
+
* Stubbing of methods re-declared with different visibilty. Fixes #109.
|
5
|
+
* Add `Mock#responds_like_instance_of`. Fixes #119.
|
6
|
+
* Make `Expectation#inspect` less verbose and more useful. Fixes #122.
|
7
|
+
* Make unit tests more robust to changes in environment. Fixes #121.
|
8
|
+
* Update README in an attempt to head Rails-related issues off at the pass.
|
9
|
+
* Add a Gem Badge to provide a link to Mocha on Rubygems.
|
10
|
+
* Make documentation example consistent with other examples.
|
11
|
+
|
3
12
|
## 0.13.1
|
4
13
|
* Fix #97 - `Mocha::ParameterMatchers#has_entry` does not work with an Array as the entry's value. Thanks to @ngokli.
|
5
14
|
* Allow deprecation `:debug` mode to be switched on from `MOCHA_OPTIONS` environment variable.
|
data/Rakefile
CHANGED
@@ -113,8 +113,14 @@ unless ENV["MOCHA_NO_DOCS"]
|
|
113
113
|
`rm -rf ./doc`
|
114
114
|
end
|
115
115
|
|
116
|
+
task 'docs_environment' do
|
117
|
+
unless ENV['GOOGLE_ANALYTICS_WEB_PROPERTY_ID']
|
118
|
+
puts "\nWarning: GOOGLE_ANALYTICS_WEB_PROPERTY_ID was not defined\n\n"
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
116
122
|
desc 'Generate documentation'
|
117
|
-
YARD::Rake::YardocTask.new('yardoc') do |task|
|
123
|
+
YARD::Rake::YardocTask.new('yardoc' => 'docs_environment') do |task|
|
118
124
|
task.options = ["--title", "Mocha #{Mocha::VERSION}"]
|
119
125
|
end
|
120
126
|
|
data/lib/mocha/class_method.rb
CHANGED
@@ -7,7 +7,8 @@ module Mocha
|
|
7
7
|
attr_reader :stubbee, :method
|
8
8
|
|
9
9
|
def initialize(stubbee, method)
|
10
|
-
@stubbee
|
10
|
+
@stubbee = stubbee
|
11
|
+
@original_method, @original_visibility = nil, nil
|
11
12
|
@method = RUBY_VERSION < '1.9' ? method.to_s : method.to_sym
|
12
13
|
end
|
13
14
|
|
@@ -37,13 +38,13 @@ module Mocha
|
|
37
38
|
if method_exists?(method)
|
38
39
|
begin
|
39
40
|
@original_method = stubbee._method(method)
|
41
|
+
@original_visibility = :public
|
42
|
+
if stubbee.__metaclass__.protected_instance_methods.include?(method)
|
43
|
+
@original_visibility = :protected
|
44
|
+
elsif stubbee.__metaclass__.private_instance_methods.include?(method)
|
45
|
+
@original_visibility = :private
|
46
|
+
end
|
40
47
|
if @original_method && @original_method.owner == stubbee.__metaclass__
|
41
|
-
@original_visibility = :public
|
42
|
-
if stubbee.__metaclass__.protected_instance_methods.include?(method)
|
43
|
-
@original_visibility = :protected
|
44
|
-
elsif stubbee.__metaclass__.private_instance_methods.include?(method)
|
45
|
-
@original_visibility = :private
|
46
|
-
end
|
47
48
|
stubbee.__metaclass__.send(:remove_method, method)
|
48
49
|
end
|
49
50
|
rescue NameError
|
@@ -74,6 +75,8 @@ module Mocha
|
|
74
75
|
else
|
75
76
|
stubbee.__metaclass__.send(:define_method, method, @original_method)
|
76
77
|
end
|
78
|
+
end
|
79
|
+
if @original_visibility
|
77
80
|
stubbee.__metaclass__.send(@original_visibility, method)
|
78
81
|
end
|
79
82
|
end
|
data/lib/mocha/expectation.rb
CHANGED
@@ -580,6 +580,13 @@ module Mocha
|
|
580
580
|
@cardinality.used?(@invocation_count)
|
581
581
|
end
|
582
582
|
|
583
|
+
# @private
|
584
|
+
def inspect
|
585
|
+
address = __id__ * 2
|
586
|
+
address += 0x100000000 if address < 0
|
587
|
+
"#<Expectation:0x#{'%x' % address} #{mocha_inspect} >"
|
588
|
+
end
|
589
|
+
|
583
590
|
# @private
|
584
591
|
def mocha_inspect
|
585
592
|
message = "#{@cardinality.mocha_inspect}, "
|
@@ -25,12 +25,12 @@ module Mocha
|
|
25
25
|
|
26
26
|
# @private
|
27
27
|
def build(message = nil, backtrace = [])
|
28
|
-
self.exception_class ||= ExpectationError
|
29
28
|
exception = exception_class.new(message)
|
30
29
|
filter = BacktraceFilter.new
|
31
30
|
exception.set_backtrace(filter.filtered(backtrace))
|
32
31
|
exception
|
33
32
|
end
|
34
33
|
end
|
34
|
+
self.exception_class = ExpectationError
|
35
35
|
end
|
36
36
|
end
|
data/lib/mocha/mock.rb
CHANGED
@@ -119,6 +119,7 @@ module Mocha
|
|
119
119
|
#
|
120
120
|
# @param [Object, #respond_to?] responder an object used to determine whether {Mock} instance should +#respond_to?+ to an invocation.
|
121
121
|
# @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
|
122
|
+
# @see #responds_like_instance_of
|
122
123
|
#
|
123
124
|
# @example Normal mocking
|
124
125
|
# sheep = mock('sheep')
|
@@ -155,13 +156,43 @@ module Mocha
|
|
155
156
|
# sheep_class.expects(:foo)
|
156
157
|
# sheep_class.respond_to?(:number_of_legs) # => true
|
157
158
|
# sheep_class.respond_to?(:foo) # => false
|
158
|
-
#
|
159
|
+
# sheep_class.number_of_legs # => 4
|
159
160
|
# sheep_class.foo # => raises NoMethodError exception
|
160
161
|
def responds_like(responder)
|
161
162
|
@responder = responder
|
162
163
|
self
|
163
164
|
end
|
164
165
|
|
166
|
+
# Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
|
167
|
+
#
|
168
|
+
# A +NoMethodError+ will be raised if the responder instance does not +#respond_to?+ a method invocation (even if the method has been expected or stubbed).
|
169
|
+
#
|
170
|
+
# The {Mock} instance will delegate its +#respond_to?+ method to the responder instance.
|
171
|
+
#
|
172
|
+
# @param [Class] responder_class a class used to determine whether {Mock} instance should +#respond_to?+ to an invocation.
|
173
|
+
# @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
|
174
|
+
# @see #responds_like
|
175
|
+
#
|
176
|
+
# @example Using {#responds_like_instance_of}
|
177
|
+
# class Sheep
|
178
|
+
# def initialize
|
179
|
+
# raise "some awkward code we don't want to call"
|
180
|
+
# end
|
181
|
+
# def chew(grass); end
|
182
|
+
# end
|
183
|
+
#
|
184
|
+
# sheep = mock('sheep')
|
185
|
+
# sheep.responds_like_instance_of(Sheep)
|
186
|
+
# sheep.expects(:chew)
|
187
|
+
# sheep.expects(:foo)
|
188
|
+
# sheep.respond_to?(:chew) # => true
|
189
|
+
# sheep.respond_to?(:foo) # => false
|
190
|
+
# sheep.chew
|
191
|
+
# sheep.foo # => raises NoMethodError exception
|
192
|
+
def responds_like_instance_of(responder_class)
|
193
|
+
responds_like(responder_class.allocate)
|
194
|
+
end
|
195
|
+
|
165
196
|
# @private
|
166
197
|
def initialize(mockery, name = nil, &block)
|
167
198
|
@mockery = mockery
|
@@ -180,6 +211,7 @@ module Mocha
|
|
180
211
|
alias_method :__stubs__, :stubs
|
181
212
|
|
182
213
|
alias_method :quacks_like, :responds_like
|
214
|
+
alias_method :quacks_like_instance_of, :responds_like_instance_of
|
183
215
|
|
184
216
|
# @private
|
185
217
|
def __expectations__
|
data/lib/mocha/version.rb
CHANGED
@@ -50,6 +50,23 @@ class UnstubbingTest < Test::Unit::TestCase
|
|
50
50
|
assert_passed(test_result)
|
51
51
|
end
|
52
52
|
|
53
|
+
def test_unstubbing_a_module_method_defined_like_fileutils_in_ruby_2_0_should_restore_original_behaviour
|
54
|
+
mod = Module.new do
|
55
|
+
def my_module_method; :original_return_value; end
|
56
|
+
private :my_module_method
|
57
|
+
extend self
|
58
|
+
class << self
|
59
|
+
public :my_module_method
|
60
|
+
end
|
61
|
+
end
|
62
|
+
test_result = run_as_test do
|
63
|
+
mod.stubs(:my_module_method).returns(:new_return_value)
|
64
|
+
mod.unstub(:my_module_method)
|
65
|
+
assert_equal :original_return_value, mod.my_module_method
|
66
|
+
end
|
67
|
+
assert_passed(test_result)
|
68
|
+
end
|
69
|
+
|
53
70
|
def test_unstubbing_an_any_instance_method_should_restore_original_behaviour
|
54
71
|
klass = Class.new do
|
55
72
|
def my_instance_method; :original_return_value; end
|
@@ -477,4 +477,21 @@ class ExpectationTest < Test::Unit::TestCase
|
|
477
477
|
assert expectation.match?(:method_one)
|
478
478
|
end
|
479
479
|
|
480
|
+
def test_should_include_default_representation_of_object_in_inspect
|
481
|
+
object = Object.new
|
482
|
+
class << object
|
483
|
+
define_method(:inspect) { 'mock' }
|
484
|
+
end
|
485
|
+
expectation = Expectation.new(object, :method_one)
|
486
|
+
assert_match Regexp.new("^#<Expectation:0x[0-9A-Fa-f]{1,12} .* >$"), expectation.inspect
|
487
|
+
end
|
488
|
+
|
489
|
+
def test_should_include_output_of_mocha_inspect_in_inspect
|
490
|
+
object = Object.new
|
491
|
+
class << object
|
492
|
+
define_method(:inspect) { 'mock' }
|
493
|
+
end
|
494
|
+
expectation = Expectation.new(object, :method_one)
|
495
|
+
assert expectation.inspect.include?(expectation.mocha_inspect)
|
496
|
+
end
|
480
497
|
end
|
data/test/unit/mock_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path('../../test_helper', __FILE__)
|
2
2
|
require 'mocha/mock'
|
3
|
-
require 'mocha/
|
3
|
+
require 'mocha/expectation_error_factory'
|
4
4
|
require 'set'
|
5
5
|
require 'simple_counter'
|
6
6
|
|
@@ -11,7 +11,7 @@ class MockTest < Test::Unit::TestCase
|
|
11
11
|
def test_should_set_single_expectation
|
12
12
|
mock = build_mock
|
13
13
|
mock.expects(:method1).returns(1)
|
14
|
-
assert_nothing_raised(
|
14
|
+
assert_nothing_raised(ExpectationErrorFactory.exception_class) do
|
15
15
|
assert_equal 1, mock.method1
|
16
16
|
end
|
17
17
|
end
|
@@ -36,7 +36,7 @@ class MockTest < Test::Unit::TestCase
|
|
36
36
|
|
37
37
|
def test_should_be_able_to_extend_mock_object_with_module
|
38
38
|
mock = build_mock
|
39
|
-
assert_nothing_raised(
|
39
|
+
assert_nothing_raised(ExpectationErrorFactory.exception_class) { mock.extend(Module.new) }
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_should_be_equal
|
@@ -102,7 +102,7 @@ class MockTest < Test::Unit::TestCase
|
|
102
102
|
mock = build_mock
|
103
103
|
mock.stub_everything
|
104
104
|
result = nil
|
105
|
-
assert_nothing_raised(
|
105
|
+
assert_nothing_raised(ExpectationErrorFactory.exception_class) do
|
106
106
|
result = mock.unexpected_method
|
107
107
|
end
|
108
108
|
assert_nil result
|
@@ -110,7 +110,7 @@ class MockTest < Test::Unit::TestCase
|
|
110
110
|
|
111
111
|
def test_should_raise_assertion_error_for_unexpected_method_call
|
112
112
|
mock = build_mock
|
113
|
-
error = assert_raise(
|
113
|
+
error = assert_raise(ExpectationErrorFactory.exception_class) do
|
114
114
|
mock.unexpected_method_called(:my_method, :argument1, :argument2)
|
115
115
|
end
|
116
116
|
assert_match(/unexpected invocation/, error.message)
|
@@ -243,11 +243,34 @@ class MockTest < Test::Unit::TestCase
|
|
243
243
|
assert_equal false, mock.respond_to?(:invoked_method)
|
244
244
|
end
|
245
245
|
|
246
|
-
def
|
246
|
+
def test_should_respond_to_methods_which_the_responder_instance_does_responds_to
|
247
|
+
klass = Class.new do
|
248
|
+
define_method(:respond_to?) { |symbol| true }
|
249
|
+
end
|
250
|
+
mock = build_mock
|
251
|
+
mock.responds_like_instance_of(klass)
|
252
|
+
assert_equal true, mock.respond_to?(:invoked_method)
|
253
|
+
end
|
254
|
+
|
255
|
+
def test_should_not_respond_to_methods_which_the_responder_instance_does_not_responds_to
|
256
|
+
klass = Class.new do
|
257
|
+
define_method(:respond_to?) { |symbol| false }
|
258
|
+
end
|
259
|
+
mock = build_mock
|
260
|
+
mock.responds_like_instance_of(klass)
|
261
|
+
assert_equal false, mock.respond_to?(:invoked_method)
|
262
|
+
end
|
263
|
+
|
264
|
+
def test_respond_like_should_return_itself_to_allow_method_chaining
|
247
265
|
mock = build_mock
|
248
266
|
assert_same mock.responds_like(Object.new), mock
|
249
267
|
end
|
250
268
|
|
269
|
+
def test_respond_like_instance_of_should_return_itself_to_allow_method_chaining
|
270
|
+
mock = build_mock
|
271
|
+
assert_same mock.responds_like_instance_of(Object), mock
|
272
|
+
end
|
273
|
+
|
251
274
|
def test_should_not_raise_no_method_error_if_mock_is_not_restricted_to_respond_like_a_responder
|
252
275
|
mock = build_mock
|
253
276
|
mock.stubs(:invoked_method)
|
@@ -292,7 +315,7 @@ class MockTest < Test::Unit::TestCase
|
|
292
315
|
|
293
316
|
def test_should_handle_respond_to_with_private_methods_param_without_error
|
294
317
|
mock = build_mock
|
295
|
-
assert_nothing_raised{ mock.respond_to?(:object_id, false) }
|
318
|
+
assert_nothing_raised { mock.respond_to?(:object_id, false) }
|
296
319
|
end
|
297
320
|
|
298
321
|
def test_should_respond_to_any_method_if_stubbing_everything
|
@@ -306,7 +329,7 @@ class MockTest < Test::Unit::TestCase
|
|
306
329
|
mock = build_mock
|
307
330
|
mock.expects(:method1)
|
308
331
|
mock.unstub(:method1)
|
309
|
-
e = assert_raises(
|
332
|
+
e = assert_raises(ExpectationErrorFactory.exception_class) { mock.method1 }
|
310
333
|
assert_match(/unexpected invocation/, e.message)
|
311
334
|
end
|
312
335
|
|
data/test/unit/mockery_test.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require File.expand_path('../../test_helper', __FILE__)
|
2
2
|
require 'mocha/mockery'
|
3
3
|
require 'mocha/state_machine'
|
4
|
+
require 'mocha/expectation_error_factory'
|
4
5
|
|
5
6
|
class MockeryTest < Test::Unit::TestCase
|
6
7
|
|
@@ -31,14 +32,14 @@ class MockeryTest < Test::Unit::TestCase
|
|
31
32
|
mock_2 = mockery.named_mock('mock-2') { expects(:method_2) }
|
32
33
|
1.times { mock_1.method_1 }
|
33
34
|
0.times { mock_2.method_2 }
|
34
|
-
assert_raises(
|
35
|
+
assert_raises(ExpectationErrorFactory.exception_class) { mockery.verify }
|
35
36
|
end
|
36
37
|
|
37
38
|
def test_should_reset_list_of_mocks_on_teardown
|
38
39
|
mockery = Mockery.new
|
39
40
|
mockery.unnamed_mock { expects(:my_method) }
|
40
41
|
mockery.teardown
|
41
|
-
assert_nothing_raised(
|
42
|
+
assert_nothing_raised(ExpectationErrorFactory.exception_class) { mockery.verify }
|
42
43
|
end
|
43
44
|
|
44
45
|
def test_should_build_instance_of_stubba_on_instantiation
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require File.expand_path('../../test_helper', __FILE__)
|
2
2
|
require 'mocha/object_methods'
|
3
3
|
require 'mocha/mock'
|
4
|
+
require 'mocha/expectation_error_factory'
|
4
5
|
|
5
6
|
class ObjectMethodsTest < Test::Unit::TestCase
|
6
7
|
|
@@ -34,7 +35,7 @@ class ObjectMethodsTest < Test::Unit::TestCase
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def test_nobody_expects_the_spanish_inquisition
|
37
|
-
assert_raise(Mocha::
|
38
|
+
assert_raise(Mocha::ExpectationErrorFactory.exception_class) { @object.expects(:the_spanish_inquisition) }
|
38
39
|
end
|
39
40
|
|
40
41
|
def test_should_alias_object_method
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<script src="/javascripts/app.js" type="text/javascript" charset="utf-8"></script>
|
2
|
+
|
3
|
+
<script type="text/javascript">
|
4
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
5
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
6
|
+
</script>
|
7
|
+
<script type="text/javascript">
|
8
|
+
try {
|
9
|
+
var pageTracker = _gat._getTracker("<%= ENV['GOOGLE_ANALYTICS_WEB_PROPERTY_ID'] %>");
|
10
|
+
pageTracker._trackPageview();
|
11
|
+
} catch(err) {}</script>
|
metadata
CHANGED
@@ -1,105 +1,103 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mocha
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
hash: 41
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 13
|
9
|
-
- 1
|
10
|
-
version: 0.13.1
|
5
|
+
version: 0.13.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- James Mead
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
date: 2013-01-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: metaclass
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
22
17
|
none: false
|
23
|
-
requirements:
|
18
|
+
requirements:
|
24
19
|
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 29
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
- 0
|
30
|
-
- 1
|
20
|
+
- !ruby/object:Gem::Version
|
31
21
|
version: 0.0.1
|
32
|
-
name: metaclass
|
33
22
|
type: :runtime
|
34
|
-
|
35
|
-
requirement: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
24
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
version: "0"
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 0.0.1
|
29
|
+
prerelease: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
46
31
|
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
47
38
|
type: :development
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
48
45
|
prerelease: false
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: introspection
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
52
49
|
none: false
|
53
|
-
requirements:
|
50
|
+
requirements:
|
54
51
|
- - ~>
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
hash: 29
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
- 0
|
60
|
-
- 1
|
52
|
+
- !ruby/object:Gem::Version
|
61
53
|
version: 0.0.1
|
62
|
-
name: introspection
|
63
54
|
type: :development
|
64
|
-
|
65
|
-
requirement: *id003
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
56
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
version: "0"
|
57
|
+
requirements:
|
58
|
+
- - ~>
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.0.1
|
61
|
+
prerelease: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
76
63
|
name: yard
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
77
70
|
type: :development
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
78
77
|
prerelease: false
|
79
|
-
|
80
|
-
|
81
|
-
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: redcarpet
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
82
81
|
none: false
|
83
|
-
requirements:
|
82
|
+
requirements:
|
84
83
|
- - ~>
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
segments:
|
88
|
-
- 1
|
89
|
-
version: "1"
|
90
|
-
name: redcarpet
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1'
|
91
86
|
type: :development
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ~>
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '1'
|
92
93
|
prerelease: false
|
93
|
-
|
94
|
-
|
94
|
+
description: Mocking and stubbing library with JMock/SchMock syntax, which allows
|
95
|
+
mocking and stubbing of methods on real (non-mock) classes.
|
95
96
|
email: mocha-developer@googlegroups.com
|
96
97
|
executables: []
|
97
|
-
|
98
98
|
extensions: []
|
99
|
-
|
100
99
|
extra_rdoc_files: []
|
101
|
-
|
102
|
-
files:
|
100
|
+
files:
|
103
101
|
- .gemtest
|
104
102
|
- .yardopts
|
105
103
|
- COPYING.md
|
@@ -336,39 +334,34 @@ files:
|
|
336
334
|
- test/unit/string_inspect_test.rb
|
337
335
|
- test/unit/thrower_test.rb
|
338
336
|
- test/unit/yield_parameters_test.rb
|
337
|
+
- yard-templates/default/layout/html/google_analytics.erb
|
338
|
+
- yard-templates/default/layout/html/setup.rb
|
339
339
|
homepage: http://gofreerange.com/mocha/docs
|
340
340
|
licenses: []
|
341
|
-
|
342
341
|
post_install_message:
|
343
342
|
rdoc_options: []
|
344
|
-
|
345
|
-
require_paths:
|
343
|
+
require_paths:
|
346
344
|
- lib
|
347
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
345
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
348
346
|
none: false
|
349
|
-
requirements:
|
350
|
-
- -
|
351
|
-
- !ruby/object:Gem::Version
|
352
|
-
|
353
|
-
segments:
|
347
|
+
requirements:
|
348
|
+
- - ! '>='
|
349
|
+
- !ruby/object:Gem::Version
|
350
|
+
segments:
|
354
351
|
- 0
|
355
|
-
|
356
|
-
|
352
|
+
hash: -598143186987414032
|
353
|
+
version: '0'
|
354
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
357
355
|
none: false
|
358
|
-
requirements:
|
359
|
-
- -
|
360
|
-
- !ruby/object:Gem::Version
|
361
|
-
|
362
|
-
segments:
|
363
|
-
- 0
|
364
|
-
version: "0"
|
356
|
+
requirements:
|
357
|
+
- - ! '>='
|
358
|
+
- !ruby/object:Gem::Version
|
359
|
+
version: '0'
|
365
360
|
requirements: []
|
366
|
-
|
367
361
|
rubyforge_project: mocha
|
368
|
-
rubygems_version: 1.8.
|
362
|
+
rubygems_version: 1.8.23
|
369
363
|
signing_key:
|
370
364
|
specification_version: 3
|
371
365
|
summary: Mocking and stubbing library
|
372
366
|
test_files: []
|
373
|
-
|
374
367
|
has_rdoc: yard
|