micro_mock 1.0.0 → 1.1.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.
data/README.md CHANGED
@@ -22,6 +22,9 @@ MyMock = MicroMock.make
22
22
  # add a class attr
23
23
  MyMock.attr(:foo)
24
24
 
25
+ # add several class attrs at once
26
+ mock.attrs(:one, :two, :three)
27
+
25
28
  # add a class attr with a default value
26
29
  MyMock.attr(:attr_with_default, "Class value")
27
30
 
@@ -34,6 +37,9 @@ mock = MyMock.new
34
37
  # add an instance attr
35
38
  mock.attr(:bar)
36
39
 
40
+ # add several instance attrs at once
41
+ mock.attrs(:first, :second, :third)
42
+
37
43
  # add an instance attr with a default value
38
44
  mock.attr(:attr_with_default, "Instance value")
39
45
 
@@ -27,6 +27,12 @@ module MicroMock
27
27
  instance_variable_set "@#{name}", default_value
28
28
  end
29
29
 
30
+ # Creates attributes for a list of names.
31
+ # @param [Symbol] names The list of attribute names.
32
+ def attrs(*names)
33
+ names.each { |name| attr(name) }
34
+ end
35
+
30
36
  # Creates a method.
31
37
  # @param [Symbol] name The name of the method.
32
38
  # @yield The block that will serve as the method body.
@@ -1,3 +1,3 @@
1
1
  module MicroMock
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
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: 1.0.0
4
+ version: 1.1.0
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: 2013-01-15 00:00:00.000000000 Z
12
+ date: 2013-01-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! ' Perhaps the lightest mocking strategy available.
15
15
 
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  version: '0'
46
46
  requirements: []
47
47
  rubyforge_project:
48
- rubygems_version: 1.8.24
48
+ rubygems_version: 1.8.23
49
49
  signing_key:
50
50
  specification_version: 3
51
51
  summary: A tiny mocking script.