factory_girl_rspec 0.0.1 → 0.0.2

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/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use ruby-1.9.3@factory_girl_rspec --create
data/README.md CHANGED
@@ -4,20 +4,13 @@ Integrate FactoryGirl fixture initialization into the RSpec DSL.
4
4
 
5
5
  ## Usage
6
6
 
7
- ```ruby
8
- # spec/factories/user_factory.rb
9
- Factory.define :user do |f|
10
- f.email 'john@acme.com'
11
- f.first_name "John"
12
- f.last_name "Doe"
13
- f.phone_number '555.5555'
14
- end
15
- ```
7
+ Basic usage:
16
8
 
17
9
  ```ruby
18
10
  # spec/models/user_spec.rb
19
11
  describe User do
20
12
  context 'basic user' do
13
+ # instantiate FactoryGirl :user fixture
21
14
  with :user
22
15
  it { user.should be_inactive }
23
16
  it { user.should_not be_happy }
@@ -25,6 +18,24 @@ describe User do
25
18
  end
26
19
  ```
27
20
 
21
+ Advanced usage:
22
+
23
+ ```ruby
24
+ # spec/models/user_spec.rb
25
+ describe User do
26
+ context 'when user.first_name == nil' do
27
+ # instantiate FactoryGirl :user fixture with custom options
28
+ with :user, :first_name => nil
29
+ it { user.should be_inactive }
30
+ it { user.should_not be_happy }
31
+ end
32
+ end
33
+ ```
34
+
35
+ ## Features
36
+ * clean and concise DSL for instantiating FactoryGirl fixtures
37
+ * easily configure deviations in fixtures with optional parameter hash
38
+
28
39
  ## Installation
29
40
 
30
41
  ```ruby
@@ -40,6 +51,7 @@ gem 'factory_girl_rspec'
40
51
  * Submit pull request on github
41
52
 
42
53
  Original implementation described on [Ryan Sonnek's blog](http://blog.codecrate.com/2011/10/cleaner-rspecfactorygirl-integration.html)
54
+
43
55
  See CONTRIBUTORS.txt for list of project contributors
44
56
 
45
57
  ## Copyright
@@ -1,5 +1,5 @@
1
1
  module FactoryGirl
2
2
  module Rspec
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@ module FactoryGirl
4
4
  module Rspec
5
5
  module With
6
6
  def with(name, options = {})
7
- let(name) { ::Factory.create(name, options) }
7
+ let(name) { ::FactoryGirl.create(name, options) }
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,63 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: factory_girl_rspec
3
- version: !ruby/object:Gem::Version
4
- hash: 29
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ryan Sonnek
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-05 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-04-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rspec
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2171415960 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 2
31
- - 0
32
- version: "2.0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '2.0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: factory_girl
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2171415960
25
+ - !ruby/object:Gem::Dependency
26
+ name: factory_girl
27
+ requirement: &2171415460 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 2
46
- - 0
47
- version: "2.0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
48
33
  type: :runtime
49
- version_requirements: *id002
50
- description: add helper methods to quickly instantiate and assign factory girl fixtures to your test context
51
- email:
34
+ prerelease: false
35
+ version_requirements: *2171415460
36
+ description: add helper methods to quickly instantiate and assign factory girl fixtures
37
+ to your test context
38
+ email:
52
39
  - ryan@codecrate.com
53
40
  executables: []
54
-
55
41
  extensions: []
56
-
57
42
  extra_rdoc_files: []
58
-
59
- files:
43
+ files:
60
44
  - .gitignore
45
+ - .rvmrc
61
46
  - CONTRIBUTORS.txt
62
47
  - Gemfile
63
48
  - LICENSE.txt
@@ -67,38 +52,34 @@ files:
67
52
  - lib/factory_girl/rspec/version.rb
68
53
  - lib/factory_girl/rspec/with.rb
69
54
  - lib/factory_girl_rspec.rb
70
- homepage: ""
55
+ homepage: ''
71
56
  licenses: []
72
-
73
57
  post_install_message:
74
58
  rdoc_options: []
75
-
76
- require_paths:
59
+ require_paths:
77
60
  - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
61
+ required_ruby_version: !ruby/object:Gem::Requirement
79
62
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ segments:
85
68
  - 0
86
- version: "0"
87
- required_rubygems_version: !ruby/object:Gem::Requirement
69
+ hash: -4568117578116489416
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
71
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ segments:
94
77
  - 0
95
- version: "0"
78
+ hash: -4568117578116489416
96
79
  requirements: []
97
-
98
80
  rubyforge_project: factory_girl_rspec
99
- rubygems_version: 1.8.5
81
+ rubygems_version: 1.8.15
100
82
  signing_key:
101
83
  specification_version: 3
102
84
  summary: integrate factory_girl directly into the RSpec DSL
103
85
  test_files: []
104
-