factory_girl_rspec 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f430609277352762527d818bbda9c23db1898439
4
- data.tar.gz: ee39364decfc0d02e57eadbf397310304f52b65b
3
+ metadata.gz: 8d0b32cfc8ea3f709914fac9905d4a050667dffc
4
+ data.tar.gz: cdc2090412a45b50c97374a1e9c57c742e7b8371
5
5
  SHA512:
6
- metadata.gz: 0ac7ef19aff949d84ffabfd7b9c5d8ee4591e220abd76a9ecbe79a83676fdb9053d15752d78f01eae5f922fccf5bc0ed11cf3cea7cb61b07c9e3a35348d2b1af
7
- data.tar.gz: c9985ff30d8b069d1c244e3842de08d56f31b13510f51e8ad7d1921ae18748c0e24337925ffcb056779dbb89e6ce0656e9ed4ca05958928ea9ca0c47854f8df9
6
+ metadata.gz: 67b8641e89054fc9105e678b200790b766eb965382d9f86b2a7e94c53b6eba35775b5138c6d80075898978ba8ee782db6b81882213fb4549d9e3b06f49800e85
7
+ data.tar.gz: 118d43fb95fce49070ab6dea005c87c3653b97a5935a209d79b5c806deb787597ffb2e562d841bc5ac96186ddc0ed2aae7162cf4708ae661082c6ee52fd834d2
data/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Integrate FactoryGirl fixture initialization into the RSpec DSL.
4
4
 
5
+ ## Features
6
+ * clean and concise DSL for instantiating FactoryGirl fixtures
7
+ * easily configure factory variations with FactoryGirl traits or optional parameter hash
8
+ * [includes FactoryGirl DSL into main Rspec context to DRY up creation](https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#using-factories)
9
+
5
10
  ## Usage
6
11
 
7
12
  Basic usage:
@@ -38,10 +43,6 @@ describe User do
38
43
  end
39
44
  ```
40
45
 
41
- ## Features
42
- * clean and concise DSL for instantiating FactoryGirl fixtures
43
- * easily configure deviations in fixtures with optional parameter hash
44
-
45
46
  ## Installation
46
47
 
47
48
  ```ruby
@@ -2,7 +2,7 @@ require 'factory_girl'
2
2
 
3
3
  module FactoryGirl
4
4
  module Rspec
5
- module With
5
+ module Dsl
6
6
  # define an rspec helper method that lazily creates the referenced
7
7
  # FactoryGirl fixture (via let)
8
8
  # example usage:
@@ -1,5 +1,5 @@
1
1
  module FactoryGirl
2
2
  module Rspec
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
- require 'factory_girl/rspec/with'
1
+ require 'factory_girl/rspec/dsl'
2
2
  require 'rspec'
3
3
 
4
4
  RSpec.configure do |config|
5
- config.extend FactoryGirl::Rspec::With
5
+ config.extend FactoryGirl::Rspec::Dsl
6
+ config.include FactoryGirl::Syntax::Methods
6
7
  end
@@ -44,4 +44,19 @@ describe FactoryGirl::Rspec do
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ describe FactoryGirl::Syntax::Methods do
49
+ context 'create' do
50
+ it 'is available without FactoryGirl prefix' do
51
+ user = create :user
52
+ expect(user).to_not be_nil
53
+ end
54
+ end
55
+ context 'build' do
56
+ it 'is available without FactoryGirl prefix' do
57
+ user = build :user
58
+ expect(user).to_not be_nil
59
+ end
60
+ end
61
+ end
47
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_girl_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-11 00:00:00.000000000 Z
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -70,8 +70,8 @@ files:
70
70
  - README.md
71
71
  - Rakefile
72
72
  - factory_girl_rspec.gemspec
73
+ - lib/factory_girl/rspec/dsl.rb
73
74
  - lib/factory_girl/rspec/version.rb
74
- - lib/factory_girl/rspec/with.rb
75
75
  - lib/factory_girl_rspec.rb
76
76
  - spec/factories/users.rb
77
77
  - spec/factory_girl_rspec_spec.rb