mocha 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/README.rdoc +1 -1
  2. data/RELEASE.rdoc +31 -28
  3. data/doc/.nojekyll +0 -0
  4. data/doc/Mocha.html +2 -2
  5. data/doc/Mocha/API.html +2 -2
  6. data/doc/Mocha/ClassMethods.html +7 -7
  7. data/doc/Mocha/Configuration.html +2 -2
  8. data/doc/Mocha/Expectation.html +2 -2
  9. data/doc/Mocha/Mock.html +2 -2
  10. data/doc/Mocha/ObjectMethods.html +17 -17
  11. data/doc/Mocha/ParameterMatchers.html +2 -2
  12. data/doc/Mocha/ParameterMatchers/AllOf.html +2 -2
  13. data/doc/Mocha/ParameterMatchers/AnyOf.html +2 -2
  14. data/doc/Mocha/ParameterMatchers/AnyParameters.html +2 -2
  15. data/doc/Mocha/ParameterMatchers/Anything.html +2 -2
  16. data/doc/Mocha/ParameterMatchers/Base.html +2 -2
  17. data/doc/Mocha/ParameterMatchers/Equals.html +2 -2
  18. data/doc/Mocha/ParameterMatchers/HasEntries.html +2 -2
  19. data/doc/Mocha/ParameterMatchers/HasEntry.html +2 -2
  20. data/doc/Mocha/ParameterMatchers/HasKey.html +2 -2
  21. data/doc/Mocha/ParameterMatchers/HasValue.html +2 -2
  22. data/doc/Mocha/ParameterMatchers/Includes.html +2 -2
  23. data/doc/Mocha/ParameterMatchers/InstanceOf.html +2 -2
  24. data/doc/Mocha/ParameterMatchers/IsA.html +2 -2
  25. data/doc/Mocha/ParameterMatchers/KindOf.html +2 -2
  26. data/doc/Mocha/ParameterMatchers/Not.html +2 -2
  27. data/doc/Mocha/ParameterMatchers/Optionally.html +2 -2
  28. data/doc/Mocha/ParameterMatchers/QueryStringMatches.html +2 -2
  29. data/doc/Mocha/ParameterMatchers/RegexpMatches.html +2 -2
  30. data/doc/Mocha/ParameterMatchers/RespondsWith.html +2 -2
  31. data/doc/Mocha/ParameterMatchers/YamlEquivalent.html +2 -2
  32. data/doc/Mocha/Sequence.html +2 -2
  33. data/doc/Mocha/StateMachine.html +2 -2
  34. data/doc/Mocha/StateMachine/State.html +2 -2
  35. data/doc/Mocha/StateMachine/StatePredicate.html +2 -2
  36. data/doc/Mocha/StubbingError.html +2 -2
  37. data/doc/Mocha/UnexpectedInvocation.html +2 -2
  38. data/doc/_index.html +3 -3
  39. data/doc/file.COPYING.html +2 -2
  40. data/doc/file.MIT-LICENSE.html +2 -2
  41. data/doc/file.README.html +4 -4
  42. data/doc/file.RELEASE.html +39 -30
  43. data/doc/file.misc.html +2 -2
  44. data/doc/file.mocha.html +2 -2
  45. data/doc/file.stubba.html +2 -2
  46. data/doc/frames.html +1 -1
  47. data/doc/index.html +4 -4
  48. data/doc/top-level-namespace.html +2 -2
  49. data/lib/mocha/class_method.rb +1 -1
  50. data/lib/mocha/object.rb +3 -0
  51. data/lib/mocha/version.rb +1 -1
  52. data/test/unit/class_method_test.rb +7 -0
  53. data/test/unit/object_test.rb +5 -0
  54. metadata +12 -11
data/doc/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Mocha 0.11.1
9
+ &mdash; Mocha 0.11.2
10
10
 
11
11
  </title>
12
12
 
@@ -102,8 +102,8 @@ the test library has been loaded…</p>
102
102
  </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>test/unit</span><span class='tstring_end'>&quot;</span></span>
103
103
  <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>mocha</span><span class='tstring_end'>&quot;</span></span></code></pre>
104
104
 
105
- <p>Note that versions 0.10.2 &amp; 0.10.3 included a bug. Please do not use
106
- these versions.</p>
105
+ <p>Note that versions 0.10.2, 0.10.3 &amp; 0.11.0 included a bug. Please do
106
+ not use these versions.</p>
107
107
 
108
108
  <p>Or install the <a href="http://www.rubyonrails.org/">Rails</a> plugin…</p>
109
109
 
@@ -144,7 +144,7 @@ href="http://www.ruby-lang.org/en/LICENSE.txt">Ruby itself</a> or under the
144
144
  </div></div>
145
145
 
146
146
  <div id="footer">
147
- Generated on Sat Apr 21 11:46:13 2012 by
147
+ Generated on Tue Apr 24 11:15:44 2012 by
148
148
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
149
149
  0.7.5 (ruby-1.9.3).
150
150
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Mocha 0.11.1
9
+ &mdash; Mocha 0.11.2
10
10
 
11
11
  </title>
12
12
 
@@ -96,7 +96,7 @@
96
96
  </div>
97
97
 
98
98
  <div id="footer">
99
- Generated on Sat Apr 21 11:46:14 2012 by
99
+ Generated on Tue Apr 24 11:15:45 2012 by
100
100
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
101
101
  0.7.5 (ruby-1.9.3).
102
102
  </div>
@@ -36,7 +36,7 @@ module Mocha
36
36
  def hide_original_method
37
37
  if method_exists?(method)
38
38
  begin
39
- @original_method = stubbee.method(method)
39
+ @original_method = stubbee.__method__(method)
40
40
  if @original_method && @original_method.owner == stubbee.__metaclass__
41
41
  @original_visibility = :public
42
42
  if stubbee.__metaclass__.protected_instance_methods.include?(method)
data/lib/mocha/object.rb CHANGED
@@ -12,6 +12,9 @@ module Mocha
12
12
  # Both {#expects} and {#stubs} return an {Expectation} which can be further modified by methods on {Expectation}.
13
13
  module ObjectMethods
14
14
 
15
+ # @private
16
+ alias_method :__method__, :method
17
+
15
18
  # @private
16
19
  def mocha
17
20
  @mocha ||= Mocha::Mockery.instance.mock_impersonating(self)
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
@@ -24,6 +24,13 @@ class ClassMethodTest < Test::Unit::TestCase
24
24
  assert_nothing_raised { method.hide_original_method }
25
25
  end
26
26
 
27
+ def test_should_not_raise_error_hiding_method_in_class_that_implements_method_called_method
28
+ klass = Class.new { def self.method; end }
29
+ method = ClassMethod.new(klass, :method)
30
+
31
+ assert_nothing_raised { method.hide_original_method }
32
+ end
33
+
27
34
  def test_should_define_a_new_method_which_should_call_mocha_method_missing
28
35
  klass = Class.new { def self.method_x; end }
29
36
  mocha = build_mock
@@ -84,4 +84,9 @@ class ObjectTest < Test::Unit::TestCase
84
84
  assert_raise(Mocha::ExpectationError) { object.expects(:the_spanish_inquisition) }
85
85
  end
86
86
 
87
+ def test_should_alias_object_method
88
+ klass = Class.new { def self.method_x; end }
89
+ assert_equal klass.__method__(:method_x), klass.method(:method_x)
90
+ end
91
+
87
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-21 00:00:00.000000000 Z
12
+ date: 2012-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: metaclass
16
- requirement: &70286755904100 !ruby/object:Gem::Requirement
16
+ requirement: &70329822526040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70286755904100
24
+ version_requirements: *70329822526040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70286755902780 !ruby/object:Gem::Requirement
27
+ requirement: &70329822524720 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70286755902780
35
+ version_requirements: *70329822524720
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: introspection
38
- requirement: &70286755902320 !ruby/object:Gem::Requirement
38
+ requirement: &70329822524260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.0.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70286755902320
46
+ version_requirements: *70329822524260
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &70286755901940 !ruby/object:Gem::Requirement
49
+ requirement: &70329822523880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70286755901940
57
+ version_requirements: *70329822523880
58
58
  description: Mocking and stubbing library with JMock/SchMock syntax, which allows
59
59
  mocking and stubbing of methods on real (non-mock) classes.
60
60
  email: mocha-developer@googlegroups.com
@@ -71,6 +71,7 @@ files:
71
71
  - README.rdoc
72
72
  - RELEASE.rdoc
73
73
  - Rakefile
74
+ - doc/.nojekyll
74
75
  - doc/Mocha.html
75
76
  - doc/Mocha/API.html
76
77
  - doc/Mocha/ClassMethods.html
@@ -360,7 +361,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
360
361
  version: '0'
361
362
  segments:
362
363
  - 0
363
- hash: -4562673917172409454
364
+ hash: 1567730914725211734
364
365
  required_rubygems_version: !ruby/object:Gem::Requirement
365
366
  none: false
366
367
  requirements: