grasshopper 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +12 -0
  2. data/lib/grasshopper.rb +15 -0
  3. metadata +4 -4
  4. data/README.rdoc +0 -8
data/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # Grasshopper
2
+
3
+ A tiny mocking framework based on Mockito
4
+
5
+ # Naming
6
+
7
+ Grasshopper is named for a [restaurant](http://grasshoppervegan.com/) in Allston, MA that serves up all sorts of great mocks.
8
+
9
+ ## Copyright
10
+
11
+ Copyright (c) 2011 Matt Raibert.
12
+ Grasshopper is available under the GPL v3 see LICENSE.txt for further details.
data/lib/grasshopper.rb CHANGED
@@ -23,3 +23,18 @@ class Mock
23
23
  mock
24
24
  end
25
25
  end
26
+
27
+ class Stub
28
+ def initialize(stubs)
29
+ @stubs = stubs
30
+ end
31
+
32
+ def method_missing(sym, *args)
33
+ return nil unless @stubs.has_key?(sym)
34
+ @stubs[sym]
35
+ end
36
+
37
+ def self.like(name = "a stub", stubs)
38
+ Stub.new(stubs)
39
+ end
40
+ 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.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -81,11 +81,11 @@ executables: []
81
81
  extensions: []
82
82
  extra_rdoc_files:
83
83
  - LICENSE.txt
84
- - README.rdoc
84
+ - README.md
85
85
  files:
86
86
  - lib/grasshopper.rb
87
87
  - LICENSE.txt
88
- - README.rdoc
88
+ - README.md
89
89
  homepage: http://github.com/mattraibert/grasshopper
90
90
  licenses:
91
91
  - GPL
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  segments:
103
103
  - 0
104
- hash: 3596318458867375716
104
+ hash: -2553078079800841230
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
data/README.rdoc DELETED
@@ -1,8 +0,0 @@
1
- = Grasshopper
2
-
3
- A tiny mocking framework based on Mockito
4
-
5
- == Copyright
6
-
7
- Copyright (c) 2011 Matt Raibert.
8
- Grasshopper is available under the GPL v3 see LICENSE.txt for further details.