mock_factory 0.0.4 → 0.0.6

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
@@ -5,3 +5,6 @@ mock_factory
5
5
  [![Dependency Status](https://gemnasium.com/brundage/mock_factory.png)](https://gemnasium.com/brundage/mock_factory)
6
6
 
7
7
  Produces [RSpec-Rails](https://github.com/rspec/rspec-rails/#readme) Mocks
8
+
9
+ * [On Github](https://github.com/brundage/mock_factory/)
10
+ * [On RubyGems](https://rubygems.org/gems/mock_factory)
data/lib/mock_factory.rb CHANGED
@@ -4,18 +4,18 @@ require 'rspec/rails/mocks'
4
4
 
5
5
  class MockFactory
6
6
 
7
- VERSION = '0.0.4'
7
+ VERSION = '0.0.6'
8
8
 
9
9
  class << self
10
10
  include RSpec::Rails::Mocks
11
11
 
12
- def create(const, &block)
13
- mock_it 'create', const, &block
12
+ def fetch(const, &block)
13
+ mock_it :fetch, const, &block
14
14
  end
15
15
 
16
16
 
17
- def fetch(const, &block)
18
- mock_it 'fetch', const, &block
17
+ def produce(const, &block)
18
+ mock_it :produce, const, &block
19
19
  end
20
20
 
21
21
  private
@@ -24,7 +24,7 @@ class MockFactory
24
24
  setup
25
25
  name = const.is_a?(String) ? const : const.name
26
26
 
27
- mock_object = if action == 'fetch'
27
+ mock_object = if action == :fetch
28
28
  @mocks[name] ||= mock_model name
29
29
  else
30
30
  mock_model name
@@ -3,23 +3,23 @@ require 'mock_factory'
3
3
 
4
4
  describe MockFactory do
5
5
 
6
- it "create makes a mock object" do
7
- o = MockFactory.create 'Blark'
6
+ it "produce makes a mock object" do
7
+ o = MockFactory.produce 'Blark'
8
8
  o.should be_a(Blark)
9
9
  end
10
10
 
11
11
 
12
- it "create applies a block to the mock" do
13
- b = MockFactory.create 'Badger' do |b|
12
+ it "produce applies a block to the mock" do
13
+ b = MockFactory.produce 'Badger' do |b|
14
14
  b.stub(:honey).and_return(true)
15
15
  end
16
16
  b.honey.should be_true
17
17
  end
18
18
 
19
19
 
20
- it "create makes a different object" do
21
- stout = MockFactory.create 'Beer'
22
- ipa = MockFactory.create 'Beer'
20
+ it "produce makes a different object" do
21
+ stout = MockFactory.produce 'Beer'
22
+ ipa = MockFactory.produce 'Beer'
23
23
  stout.should_not === ipa
24
24
  end
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock_factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
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-06-23 00:00:00.000000000 Z
12
+ date: 2012-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: 551829121
118
+ hash: 822205455
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements:
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  segments:
126
126
  - 0
127
- hash: 551829121
127
+ hash: 822205455
128
128
  requirements: []
129
129
  rubyforge_project: mock_factory
130
130
  rubygems_version: 1.8.24