mocha 1.0.0.alpha → 1.0.0
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.
- checksums.yaml +4 -4
- data/README.md +55 -17
- data/RELEASE.md +17 -14
- data/lib/mocha/version.rb +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed8646b69b6a5163de10f8bbc6dd5e77b090d451
|
4
|
+
data.tar.gz: 42bde3df9467a0a8eac75c3ca816565a9f967feb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4839f1d90cc07fc20e1662c00a51e6406ac612cbe0c05d25e8abe16a3845eeb8369daf2e516f97e4f8ddd277d93cdd9db47ca9c76f6aa1fab7cbe10ce4b429fd
|
7
|
+
data.tar.gz: e36f0c3f28b5d58fbb3467ec305458ef013660df54f465440d5e249160c79ae6b2f622aad0a8d4d2b78272f758726891178267011fa107c59081c89bad42e70b
|
data/README.md
CHANGED
@@ -17,29 +17,63 @@ Install the latest version of the gem with the following command...
|
|
17
17
|
|
18
18
|
Note: If you are intending to use Mocha with Test::Unit or MiniTest, you should only setup Mocha *after* loading the relevant test library...
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
##### Test::Unit
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'rubygems'
|
24
|
+
gem 'mocha'
|
25
|
+
require 'test/unit'
|
26
|
+
require 'mocha/test_unit'
|
27
|
+
```
|
28
|
+
|
29
|
+
##### MiniTest
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require 'rubygems'
|
33
|
+
gem 'mocha'
|
34
|
+
require 'minitest/unit'
|
35
|
+
require 'mocha/mini_test'
|
36
|
+
```
|
22
37
|
|
23
38
|
#### Bundler
|
24
39
|
|
25
40
|
If you're using Bundler, include Mocha in the `Gemfile` and then setup Mocha later once you know the test library has been loaded...
|
26
41
|
|
27
|
-
|
28
|
-
|
42
|
+
##### Test::Unit
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
# Gemfile
|
46
|
+
gem "mocha"
|
47
|
+
|
48
|
+
# Elsewhere after Bundler has loaded gems e.g. after `require 'bundler/setup'`
|
49
|
+
require "test/unit"
|
50
|
+
require "mocha/test_unit"
|
51
|
+
```
|
52
|
+
|
53
|
+
##### MiniTest
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# Gemfile
|
57
|
+
gem "mocha"
|
29
58
|
|
30
|
-
|
31
|
-
|
32
|
-
|
59
|
+
# Elsewhere after Bundler has loaded gems e.g. after `require 'bundler/setup'`
|
60
|
+
require "minitest/unit"
|
61
|
+
require "mocha/mini_test"
|
62
|
+
```
|
33
63
|
|
34
64
|
#### Rails
|
35
65
|
|
36
66
|
If you're loading Mocha using Bundler within a Rails application, you should setup Mocha manually e.g. at the bottom of your `test_helper.rb`.
|
37
67
|
|
38
|
-
|
39
|
-
gem "mocha"
|
68
|
+
##### MiniTest
|
40
69
|
|
41
|
-
|
42
|
-
|
70
|
+
```ruby
|
71
|
+
# Gemfile in Rails app
|
72
|
+
gem 'mocha'
|
73
|
+
|
74
|
+
# At bottom of test_helper.rb (or at least after `require 'rails/test_help'`)
|
75
|
+
require 'mocha/mini_test'
|
76
|
+
```
|
43
77
|
|
44
78
|
#### Rails Plugin
|
45
79
|
|
@@ -49,8 +83,12 @@ Install the Rails plugin...
|
|
49
83
|
|
50
84
|
Note: As of version 0.9.8, the Mocha plugin is not automatically setup at plugin load time. Instead it must be manually setup e.g. at the bottom of your `test_helper.rb`.
|
51
85
|
|
52
|
-
|
53
|
-
|
86
|
+
##### MiniTest
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
# At bottom of test_helper.rb (or at least after `require 'rails/test_help'`)
|
90
|
+
require 'mocha/mini_test'
|
91
|
+
```
|
54
92
|
|
55
93
|
#### Know Issues
|
56
94
|
|
@@ -65,7 +103,7 @@ Note: As of version 0.9.8, the Mocha plugin is not automatically setup at plugin
|
|
65
103
|
|
66
104
|
```ruby
|
67
105
|
require 'test/unit'
|
68
|
-
require 'mocha/
|
106
|
+
require 'mocha/test_unit'
|
69
107
|
|
70
108
|
class MiscExampleTest < Test::Unit::TestCase
|
71
109
|
def test_mocking_a_class_method
|
@@ -121,7 +159,7 @@ class Enterprise
|
|
121
159
|
end
|
122
160
|
|
123
161
|
require 'test/unit'
|
124
|
-
require 'mocha/
|
162
|
+
require 'mocha/test_unit'
|
125
163
|
|
126
164
|
class EnterpriseTest < Test::Unit::TestCase
|
127
165
|
def test_should_boldly_go
|
@@ -167,7 +205,7 @@ class Order
|
|
167
205
|
end
|
168
206
|
|
169
207
|
require 'test/unit'
|
170
|
-
require 'mocha/
|
208
|
+
require 'mocha/test_unit'
|
171
209
|
|
172
210
|
class OrderTest < Test::Unit::TestCase
|
173
211
|
# illustrates stubbing instance method
|
@@ -238,7 +276,7 @@ See this [list of contributors](https://github.com/freerange/mocha/graphs/contri
|
|
238
276
|
|
239
277
|
### Translations
|
240
278
|
|
241
|
-
* [Serbo-Croatian](http://science.webhostinggeeks.com/mocha) by [WHG Team](http://webhostinggeeks.com/).
|
279
|
+
* [Serbo-Croatian](http://science.webhostinggeeks.com/mocha) by [WHG Team](http://webhostinggeeks.com/). (may be out-of-date)
|
242
280
|
|
243
281
|
### History
|
244
282
|
|
data/RELEASE.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# Release Notes
|
2
2
|
|
3
|
-
## 1.0.0
|
3
|
+
## 1.0.0
|
4
4
|
|
5
|
+
### External changes
|
5
6
|
* Assume 'mocha' has been required when requiring 'mocha/setup'.
|
6
7
|
* Provide shortcuts for integrating with specific test library i.e. `require 'mocha/test_unit'` or `require 'mocha/mini_test'`
|
7
8
|
as alternatives to `require 'mocha/setup'`.
|
@@ -13,8 +14,20 @@ Note: this may break existing tests which rely on the old behaviour. Stubbing a
|
|
13
14
|
method on a child class would previously cause an unexpected invocation error. By searching up through the inheritance
|
14
15
|
hierarchy for each of the delegate mock objects, we can provide more intuitive behaviour. Instead of an unexpected invocation
|
15
16
|
error, invoking the method on the child class will cause the stubbed method on the superclass to be used.
|
16
|
-
* Run the standard test suite against Ruby 2.1.0 in the build matrix.
|
17
17
|
* Avoid recursion when constructing unexpected invocation message. Fixes #168.
|
18
|
+
* Add explanation of method dispatch. Heavily based on the relevant jMock v1 documentation. Fixes #172.
|
19
|
+
* Make class_eval line number more accurate. This sets the line number as the line number of the `def` statement. Closes #169.
|
20
|
+
* Allow nesting of `responds_with` parameter matcher. Closes #166.
|
21
|
+
* Define `Mocha` module before it's referenced. The test helper defines a class `TestCase` within the `Mocha` module. When
|
22
|
+
running the tests inside the bundle, the `Mocha` module happens to be defined at this point. However when running the tests outside the bundle, it is not defined and so an exception is raised: `uninitialized constant Mocha (NameError)`. Fixes #163.
|
23
|
+
* Document lack of thread-safety. Fixes #154.
|
24
|
+
* Document how to use the build-matrix script. Fixes #160.
|
25
|
+
* Stubbing non-public method should use same visibility. This will probably break some existing tests that were somehow relying
|
26
|
+
on the stubbed method being public while the original method was protected or private. Fixes #150.
|
27
|
+
|
28
|
+
### Internal changes
|
29
|
+
* Use lastest Rubygems in Travis CI builds.
|
30
|
+
* Run the standard test suite against Ruby 2.1.0 in the build matrix.
|
18
31
|
* Run integration tests against Ruby 2.0.0 with latest Test::Unit gem in the build matrix.
|
19
32
|
* Test::Unit is not available in Ruby v1.9.3 standard library, so remove it from the build matrix.
|
20
33
|
* Force use of Test::Unit runner, etc in relevant integration tests. Prior to this, I don't think we were really testing the
|
@@ -25,20 +38,10 @@ MiniTest gem was not loaded.
|
|
25
38
|
* Reset environment variables between build matrix builds.
|
26
39
|
* Only activate integration with relevant test library for each of the integration tests.
|
27
40
|
* Include standard build combinations from Travis CI config i.e. builds using standard library versions of test libraries.
|
28
|
-
* Add explanation of method dispatch. Heavily based on the relevant jMock v1 documentation. Fixes #172.
|
29
|
-
* Make class_eval line number more accurate. This sets the line number as the line number of the `def` statement. Closes #169.
|
30
|
-
* Allow nesting of `responds_with` parameter matcher. Closes #166.
|
31
|
-
* Define `Mocha` module before it's referenced. The test helper defines a class `TestCase` within the `Mocha` module. When
|
32
|
-
running the tests inside the bundle, the `Mocha` module happens to be defined at this point. However when running the tests outside the bundle, it is not defined and so an exception is raised: `uninitialized constant Mocha (NameError)`. Fixes #163.
|
33
|
-
* Document lack of thread-safety. Fixes #154.
|
34
|
-
* Document how to use the build-matrix script. Fixes #160.
|
35
|
-
* Stubbing non-public method should use same visibility. This will probably break some existing tests that were somehow relying
|
36
|
-
on the stubbed method being public while the original method was protected or private. Fixes #150.
|
37
|
-
* Remove ruby version map from build matrix script. I'm using the `rbenv-aliases` plugin to alias minor versions to the
|
38
|
-
relevant patch version.
|
39
41
|
* Fix `build-matrix.rb` script. Also use `.travis.yml` to decide what combinations to run. This means we
|
40
42
|
can now simulate the Travis CI build locally and avoid duplication. Fixes #157.
|
41
|
-
|
43
|
+
* Remove Ruby version map from build matrix script. I'm using the `rbenv-aliases` plugin to alias minor versions to the
|
44
|
+
relevant patch version.
|
42
45
|
|
43
46
|
## 0.14.0
|
44
47
|
|
data/lib/mocha/version.rb
CHANGED
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mocha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Mead
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metaclass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: introspection
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.0.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.0.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: yard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: redcarpet
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1'
|
83
83
|
description: Mocking and stubbing library with JMock/SchMock syntax, which allows
|
@@ -87,8 +87,8 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
-
|
91
|
-
-
|
90
|
+
- .gemtest
|
91
|
+
- .yardopts
|
92
92
|
- COPYING.md
|
93
93
|
- Gemfile
|
94
94
|
- MIT-LICENSE.md
|
@@ -345,12 +345,12 @@ require_paths:
|
|
345
345
|
- lib
|
346
346
|
required_ruby_version: !ruby/object:Gem::Requirement
|
347
347
|
requirements:
|
348
|
-
- -
|
348
|
+
- - '>='
|
349
349
|
- !ruby/object:Gem::Version
|
350
350
|
version: '0'
|
351
351
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
352
352
|
requirements:
|
353
|
-
- -
|
353
|
+
- - '>='
|
354
354
|
- !ruby/object:Gem::Version
|
355
355
|
version: '0'
|
356
356
|
requirements: []
|