micro_mock 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module MicroMock
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/lib/micro_mock.rb CHANGED
@@ -17,8 +17,10 @@ module MicroMock
17
17
 
18
18
  # Creates an attribute getter & setter.
19
19
  # @param [Symbol] name The name of the attribute.
20
- def attr(name)
20
+ # @param [Object] default_value An optional default value.
21
+ def attr(name, default_value=nil)
21
22
  context.send :attr_accessor, name
23
+ instance_variable_set "@#{name}", default_value
22
24
  end
23
25
 
24
26
  # Stubs a method.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
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-11-20 00:00:00.000000000 Z
12
+ date: 2012-11-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! ' Perhaps the lightest mocking strategy available.
15
15