grasshopper 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,7 +20,7 @@ Mock.verify(mock).goodbye # wait(AssertionFailed)! they left without saying g
20
20
 
21
21
  ### Stub
22
22
 
23
- Stub is a person who holds something for you and gives it to anyone who knows how to ask. You can ask Stub for anything, but you'll only get what you put into it.
23
+ Stub is a person who holds something for you and gives it to anyone who knows how to ask. You can ask Stub for anything, but you'll only get out what you put into it.
24
24
 
25
25
  ```ruby
26
26
  stub = Stub.new
@@ -46,5 +46,5 @@ Grasshopper is named for a [restaurant](http://grasshoppervegan.com/) in Allston
46
46
 
47
47
  ## Copyright
48
48
 
49
- Copyright (c) 2011 Matt Raibert.
49
+ Copyright (c) 2011-2012 Matt Raibert.
50
50
  Grasshopper is available under the GPL v3 see LICENSE.txt for further details.
@@ -11,11 +11,12 @@ class Mock
11
11
  @messages ||= []
12
12
  if @verify_next
13
13
  index = @messages.index { |item| message == item[0] and item[1] == args }
14
- assert(index, "Should have seen an invocation of #{message}")
14
+ assert(index, "Should have seen an invocation of #{message}(#{args.join(", ")})\n#{@messages.inspect}")
15
15
  @messages.delete_at(index || @messages.length)
16
16
  else
17
17
  @messages << [message, args]
18
18
  end
19
+ nil
19
20
  end
20
21
 
21
22
  def self.verify mock
@@ -60,4 +60,11 @@ class MockTest < MiniTest::Unit::TestCase
60
60
  Mock.verify(mock).message_with_param("param")
61
61
  end
62
62
  end
63
+
64
+ def test_always_returns_nil
65
+ mock = Mock.new
66
+ assert_nil mock.anything
67
+ assert_nil mock.anything("even with params")
68
+ assert_nil mock.anything(["even with array params"])
69
+ end
63
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grasshopper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-02 00:00:00.000000000 Z
12
+ date: 2012-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -75,8 +75,24 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
- description: A tiny mocking framework focused on the [Arrage-Act-Assert](http://c2.com/cgi/wiki?ArrangeActAssert)
79
- test pattern. Grasshopper is heavily modeled after [Mockito](http://code.google.com/p/mockito/).
78
+ - !ruby/object:Gem::Dependency
79
+ name: posto
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ description: A tiny mocking framework focused on the Arrage-Act-Assert test pattern.
95
+ Grasshopper is heavily modeled after Mockito.
80
96
  email: mattraibert@gmail.com
81
97
  executables: []
82
98
  extensions: []
@@ -89,9 +105,9 @@ files:
89
105
  - lib/grasshopper/stub.rb
90
106
  - LICENSE.txt
91
107
  - README.md
108
+ - test/stub_test.rb
92
109
  - test/test_helper.rb
93
110
  - test/mock_test.rb
94
- - test/stub_test.rb
95
111
  homepage: http://github.com/mattraibert/grasshopper
96
112
  licenses:
97
113
  - GPLv3
@@ -107,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
123
  version: '0'
108
124
  segments:
109
125
  - 0
110
- hash: -2614166097439653959
126
+ hash: -4356963894468018245
111
127
  required_rubygems_version: !ruby/object:Gem::Requirement
112
128
  none: false
113
129
  requirements:
@@ -121,6 +137,6 @@ signing_key:
121
137
  specification_version: 3
122
138
  summary: A tiny mocking framework focused on the Arrange-Act-Assert test pattern
123
139
  test_files:
140
+ - test/stub_test.rb
124
141
  - test/test_helper.rb
125
142
  - test/mock_test.rb
126
- - test/stub_test.rb