factory_girl_rspec 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
@@ -0,0 +1,5 @@
1
+ Ryan Sonnek - Original Author
2
+
3
+
4
+ Complete list of contributors:
5
+ https://github.com/wireframe/factory_girl_rspec/contributors
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in factory_girl_rspec.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2011 Ryan Sonnek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
@@ -0,0 +1,48 @@
1
+ # factory_girl_rspec
2
+
3
+ Integrate FactoryGirl fixture initialization into the RSpec DSL.
4
+
5
+ ## Usage
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
+ ```
16
+
17
+ ```ruby
18
+ # spec/models/user_spec.rb
19
+ describe User do
20
+ context 'basic user' do
21
+ with :user
22
+ it { user.should be_inactive }
23
+ it { user.should_not be_happy }
24
+ end
25
+ end
26
+ ```
27
+
28
+ ## Installation
29
+
30
+ ```ruby
31
+ # Bundler Gemfile
32
+ gem 'factory_girl_rspec'
33
+ ```
34
+
35
+ ## Contributing
36
+
37
+ * Fork the project
38
+ * Fix the issue
39
+ * Add unit tests
40
+ * Submit pull request on github
41
+
42
+ Original implementation described on [Ryan Sonnek's blog](http://blog.codecrate.com/2011/10/cleaner-rspecfactorygirl-integration.html)
43
+ See CONTRIBUTORS.txt for list of project contributors
44
+
45
+ ## Copyright
46
+
47
+ Copyright (c) 2011 Ryan Sonnek
48
+ See LICENSE.txt for further details.
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "factory_girl/rspec/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "factory_girl_rspec"
7
+ s.version = FactoryGirl::Rspec::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Ryan Sonnek"]
10
+ s.email = ["ryan@codecrate.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{integrate factory_girl directly into the RSpec DSL}
13
+ s.description = %q{add helper methods to quickly instantiate and assign factory girl fixtures to your test context}
14
+
15
+ s.rubyforge_project = "factory_girl_rspec"
16
+
17
+ s.add_runtime_dependency 'rspec', '>= 2.0'
18
+ s.add_runtime_dependency 'factory_girl', '>= 2.0'
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
+ s.require_paths = ["lib"]
24
+ end
@@ -0,0 +1,5 @@
1
+ module FactoryGirl
2
+ module Rspec
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ require 'factory_girl'
2
+
3
+ module FactoryGirl
4
+ module Rspec
5
+ module With
6
+ def with(name, options = {})
7
+ let(name) { ::Factory.create(name, options) }
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ require 'factory_girl/rspec/with'
2
+ require 'rspec'
3
+
4
+ RSpec.configure do |config|
5
+ config.extend FactoryGirl::Rspec::With
6
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: factory_girl_rspec
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Ryan Sonnek
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-10-05 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 2
31
+ - 0
32
+ version: "2.0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: factory_girl
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 2
46
+ - 0
47
+ version: "2.0"
48
+ 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:
52
+ - ryan@codecrate.com
53
+ executables: []
54
+
55
+ extensions: []
56
+
57
+ extra_rdoc_files: []
58
+
59
+ files:
60
+ - .gitignore
61
+ - CONTRIBUTORS.txt
62
+ - Gemfile
63
+ - LICENSE.txt
64
+ - README.md
65
+ - Rakefile
66
+ - factory_girl_rspec.gemspec
67
+ - lib/factory_girl/rspec/version.rb
68
+ - lib/factory_girl/rspec/with.rb
69
+ - lib/factory_girl_rspec.rb
70
+ homepage: ""
71
+ licenses: []
72
+
73
+ post_install_message:
74
+ rdoc_options: []
75
+
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ requirements: []
97
+
98
+ rubyforge_project: factory_girl_rspec
99
+ rubygems_version: 1.8.5
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: integrate factory_girl directly into the RSpec DSL
103
+ test_files: []
104
+