webmock-resources 0.0.6 → 0.0.7

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.
@@ -5,6 +5,10 @@ module WebMock::Resources
5
5
  @instance ||= new
6
6
  end
7
7
 
8
+ def [] key
9
+ super(key) || super(key.to_s.pluralize.to_sym)
10
+ end
11
+
8
12
  def []= resource, schema
9
13
  stub_resource resource
10
14
  super resource, schema
@@ -1,7 +1,5 @@
1
1
  module WebMock
2
2
  module Resources
3
-
4
- VERSION = "0.0.6"
5
-
3
+ VERSION = "0.0.7"
6
4
  end
7
5
  end
@@ -167,4 +167,10 @@ describe WebMock::Resources do
167
167
  @resource.must_be_kind_of AutoloadedObject
168
168
  end
169
169
 
170
+ it 'creates an resource given its singular name' do
171
+ @resource = WebMock::Resources.create(:some_object, name: 'foobar')
172
+ @resource.must_be_kind_of SomeObject
173
+ @resource.name.must_equal "foobar"
174
+ end
175
+
170
176
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 1.8.24
142
+ rubygems_version: 1.8.23
143
143
  signing_key:
144
144
  specification_version: 3
145
145
  summary: Remote resource definition for tests/specs