factory_girl 4.2.0 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +29 -7
- data/.yardopts +1 -1
- data/Appraisals +12 -8
- data/CONTRIBUTING.md +60 -0
- data/GETTING_STARTED.md +473 -191
- data/Gemfile +6 -3
- data/Gemfile.lock +93 -65
- data/LICENSE +1 -1
- data/NAME.md +11 -0
- data/NEWS +43 -1
- data/README.md +52 -28
- data/Rakefile +1 -3
- data/factory_girl.gemspec +9 -17
- data/gemfiles/3.2.gemfile +6 -3
- data/gemfiles/3.2.gemfile.lock +85 -62
- data/gemfiles/4.0.gemfile +6 -3
- data/gemfiles/4.0.gemfile.lock +84 -74
- data/gemfiles/4.1.gemfile +10 -0
- data/gemfiles/4.1.gemfile.lock +104 -0
- data/gemfiles/4.2.gemfile +10 -0
- data/gemfiles/4.2.gemfile.lock +104 -0
- data/gemfiles/5.0.gemfile +10 -0
- data/gemfiles/5.0.gemfile.lock +103 -0
- data/lib/factory_girl/attribute/dynamic.rb +4 -1
- data/lib/factory_girl/attribute_assigner.rb +4 -4
- data/lib/factory_girl/attribute_list.rb +1 -1
- data/lib/factory_girl/callback.rb +1 -1
- data/lib/factory_girl/callbacks_observer.rb +1 -1
- data/lib/factory_girl/configuration.rb +7 -2
- data/lib/factory_girl/declaration_list.rb +2 -2
- data/lib/factory_girl/decorator/attribute_hash.rb +1 -2
- data/lib/factory_girl/decorator/class_key_hash.rb +2 -1
- data/lib/factory_girl/decorator.rb +2 -2
- data/lib/factory_girl/definition.rb +25 -15
- data/lib/factory_girl/definition_hierarchy.rb +1 -1
- data/lib/factory_girl/definition_proxy.rb +15 -17
- data/lib/factory_girl/errors.rb +6 -0
- data/lib/factory_girl/evaluator.rb +7 -1
- data/lib/factory_girl/factory.rb +3 -3
- data/lib/factory_girl/factory_runner.rb +7 -1
- data/lib/factory_girl/find_definitions.rb +3 -3
- data/lib/factory_girl/linter.rb +97 -0
- data/lib/factory_girl/strategy/stub.rb +58 -20
- data/lib/factory_girl/strategy_syntax_method_registrar.rb +17 -0
- data/lib/factory_girl/syntax/default.rb +8 -0
- data/lib/factory_girl/syntax/methods.rb +18 -2
- data/lib/factory_girl/version.rb +1 -1
- data/lib/factory_girl.rb +30 -3
- metadata +65 -249
- data/CONTRIBUTION_GUIDELINES.md +0 -10
- data/features/find_definitions.feature +0 -75
- data/features/step_definitions/database_steps.rb +0 -9
- data/features/step_definitions/factory_girl_steps.rb +0 -36
- data/features/support/env.rb +0 -10
- data/features/support/factories.rb +0 -16
- data/gemfiles/3.0.gemfile +0 -7
- data/gemfiles/3.0.gemfile.lock +0 -81
- data/gemfiles/3.1.gemfile +0 -7
- data/gemfiles/3.1.gemfile.lock +0 -82
- data/spec/acceptance/activesupport_instrumentation_spec.rb +0 -62
- data/spec/acceptance/aliases_spec.rb +0 -19
- data/spec/acceptance/attribute_aliases_spec.rb +0 -45
- data/spec/acceptance/attribute_existing_on_object_spec.rb +0 -68
- data/spec/acceptance/attributes_for_spec.rb +0 -97
- data/spec/acceptance/attributes_from_instance_spec.rb +0 -53
- data/spec/acceptance/attributes_ordered_spec.rb +0 -51
- data/spec/acceptance/build_list_spec.rb +0 -56
- data/spec/acceptance/build_spec.rb +0 -86
- data/spec/acceptance/build_stubbed_spec.rb +0 -161
- data/spec/acceptance/callbacks_spec.rb +0 -177
- data/spec/acceptance/create_list_spec.rb +0 -97
- data/spec/acceptance/create_spec.rb +0 -116
- data/spec/acceptance/define_child_before_parent_spec.rb +0 -21
- data/spec/acceptance/definition_spec.rb +0 -21
- data/spec/acceptance/definition_without_block_spec.rb +0 -15
- data/spec/acceptance/global_initialize_with_spec.rb +0 -82
- data/spec/acceptance/global_to_create_spec.rb +0 -122
- data/spec/acceptance/initialize_with_spec.rb +0 -217
- data/spec/acceptance/keyed_by_class_spec.rb +0 -22
- data/spec/acceptance/modify_factories_spec.rb +0 -184
- data/spec/acceptance/modify_inherited_spec.rb +0 -52
- data/spec/acceptance/nested_attributes_spec.rb +0 -32
- data/spec/acceptance/overrides_spec.rb +0 -61
- data/spec/acceptance/parent_spec.rb +0 -90
- data/spec/acceptance/register_strategies_spec.rb +0 -128
- data/spec/acceptance/sequence_context_spec.rb +0 -52
- data/spec/acceptance/sequence_spec.rb +0 -61
- data/spec/acceptance/skip_create_spec.rb +0 -19
- data/spec/acceptance/stub_spec.rb +0 -62
- data/spec/acceptance/syntax_methods_within_dynamic_attributes_spec.rb +0 -41
- data/spec/acceptance/traits_spec.rb +0 -727
- data/spec/acceptance/transient_attributes_spec.rb +0 -124
- data/spec/factory_girl/aliases_spec.rb +0 -31
- data/spec/factory_girl/attribute/association_spec.rb +0 -28
- data/spec/factory_girl/attribute/dynamic_spec.rb +0 -52
- data/spec/factory_girl/attribute/sequence_spec.rb +0 -16
- data/spec/factory_girl/attribute/static_spec.rb +0 -19
- data/spec/factory_girl/attribute_list_spec.rb +0 -143
- data/spec/factory_girl/attribute_spec.rb +0 -16
- data/spec/factory_girl/callback_spec.rb +0 -41
- data/spec/factory_girl/declaration/implicit_spec.rb +0 -25
- data/spec/factory_girl/declaration_list_spec.rb +0 -67
- data/spec/factory_girl/definition_proxy_spec.rb +0 -215
- data/spec/factory_girl/definition_spec.rb +0 -58
- data/spec/factory_girl/disallows_duplicates_registry_spec.rb +0 -19
- data/spec/factory_girl/evaluator_class_definer_spec.rb +0 -77
- data/spec/factory_girl/factory_spec.rb +0 -259
- data/spec/factory_girl/find_definitions_spec.rb +0 -110
- data/spec/factory_girl/null_factory_spec.rb +0 -13
- data/spec/factory_girl/null_object_spec.rb +0 -22
- data/spec/factory_girl/registry_spec.rb +0 -68
- data/spec/factory_girl/sequence_spec.rb +0 -95
- data/spec/factory_girl/strategy/attributes_for_spec.rb +0 -18
- data/spec/factory_girl/strategy/build_spec.rb +0 -7
- data/spec/factory_girl/strategy/create_spec.rb +0 -25
- data/spec/factory_girl/strategy/stub_spec.rb +0 -38
- data/spec/factory_girl/strategy_calculator_spec.rb +0 -29
- data/spec/factory_girl_spec.rb +0 -22
- data/spec/spec_helper.rb +0 -26
- data/spec/support/macros/define_constant.rb +0 -86
- data/spec/support/matchers/callback.rb +0 -9
- data/spec/support/matchers/declaration.rb +0 -83
- data/spec/support/matchers/delegate.rb +0 -44
- data/spec/support/matchers/trait.rb +0 -9
- data/spec/support/shared_examples/strategy.rb +0 -90
data/Gemfile
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
source
|
2
|
-
|
3
|
-
gem "activerecord", :require => false
|
1
|
+
source 'https://rubygems.org'
|
4
2
|
|
5
3
|
gemspec
|
4
|
+
|
5
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
6
|
+
gem 'jdbc-sqlite3', platforms: :jruby
|
7
|
+
|
8
|
+
gem 'sqlite3', '~> 1.3.10', platforms: :ruby
|
data/Gemfile.lock
CHANGED
@@ -1,88 +1,116 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
factory_girl (4.
|
4
|
+
factory_girl (4.8.1)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (
|
11
|
-
activesupport (=
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
activemodel (5.0.0.1)
|
11
|
+
activesupport (= 5.0.0.1)
|
12
|
+
activerecord (5.0.0.1)
|
13
|
+
activemodel (= 5.0.0.1)
|
14
|
+
activesupport (= 5.0.0.1)
|
15
|
+
arel (~> 7.0)
|
16
|
+
activerecord-jdbc-adapter (1.3.21)
|
17
|
+
activerecord (>= 2.2)
|
18
|
+
activerecord-jdbcsqlite3-adapter (1.3.21)
|
19
|
+
activerecord-jdbc-adapter (~> 1.3.21)
|
20
|
+
jdbc-sqlite3 (>= 3.7.2, < 3.9)
|
21
|
+
activesupport (5.0.0.1)
|
22
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
23
|
+
i18n (~> 0.7)
|
24
|
+
minitest (~> 5.1)
|
25
|
+
tzinfo (~> 1.1)
|
26
|
+
appraisal (2.1.0)
|
22
27
|
bundler
|
23
28
|
rake
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
thor (>= 0.14.0)
|
30
|
+
arel (7.1.4)
|
31
|
+
aruba (0.13.0)
|
32
|
+
childprocess (~> 0.5.6)
|
33
|
+
contracts (~> 0.9)
|
34
|
+
cucumber (>= 1.3.19)
|
35
|
+
ffi (~> 1.9.10)
|
36
|
+
rspec-expectations (>= 2.99)
|
37
|
+
thor (~> 0.19)
|
38
|
+
builder (3.2.2)
|
39
|
+
childprocess (0.5.9)
|
40
|
+
ffi (~> 1.0, >= 1.0.11)
|
41
|
+
concurrent-ruby (1.0.2)
|
42
|
+
concurrent-ruby (1.0.2-java)
|
43
|
+
contracts (0.13.0)
|
44
|
+
cucumber (1.3.20)
|
36
45
|
builder (>= 2.1.2)
|
37
46
|
diff-lcs (>= 1.1.3)
|
38
|
-
gherkin (~> 2.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
gherkin (2.
|
46
|
-
json (>= 1.4.6)
|
47
|
-
i18n (0.6.1)
|
48
|
-
json (1.7.5)
|
49
|
-
json (1.7.5-java)
|
50
|
-
metaclass (0.0.1)
|
51
|
-
mocha (0.13.0)
|
52
|
-
metaclass (~> 0.0.1)
|
53
|
-
multi_json (1.5.0)
|
54
|
-
rake (0.9.2.2)
|
55
|
-
rspec (2.12.0)
|
56
|
-
rspec-core (~> 2.12.0)
|
57
|
-
rspec-expectations (~> 2.12.0)
|
58
|
-
rspec-mocks (~> 2.12.0)
|
59
|
-
rspec-core (2.12.2)
|
60
|
-
rspec-expectations (2.12.1)
|
61
|
-
diff-lcs (~> 1.1.3)
|
62
|
-
rspec-mocks (2.12.1)
|
63
|
-
simplecov (0.6.2)
|
47
|
+
gherkin (~> 2.12)
|
48
|
+
multi_json (>= 1.7.5, < 2.0)
|
49
|
+
multi_test (>= 0.1.2)
|
50
|
+
diff-lcs (1.2.5)
|
51
|
+
docile (1.1.5)
|
52
|
+
ffi (1.9.10)
|
53
|
+
ffi (1.9.10-java)
|
54
|
+
gherkin (2.12.2)
|
64
55
|
multi_json (~> 1.3)
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
56
|
+
gherkin (2.12.2-java)
|
57
|
+
multi_json (~> 1.3)
|
58
|
+
i18n (0.7.0)
|
59
|
+
jdbc-sqlite3 (3.8.11.2)
|
60
|
+
json (1.8.6)
|
61
|
+
json (1.8.6-java)
|
62
|
+
minitest (5.9.1)
|
63
|
+
multi_json (1.11.2)
|
64
|
+
multi_test (0.1.2)
|
65
|
+
rake (10.5.0)
|
66
|
+
rspec (3.4.0)
|
67
|
+
rspec-core (~> 3.4.0)
|
68
|
+
rspec-expectations (~> 3.4.0)
|
69
|
+
rspec-mocks (~> 3.4.0)
|
70
|
+
rspec-core (3.4.2)
|
71
|
+
rspec-support (~> 3.4.0)
|
72
|
+
rspec-expectations (3.4.0)
|
73
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
+
rspec-support (~> 3.4.0)
|
75
|
+
rspec-its (1.2.0)
|
76
|
+
rspec-core (>= 3.0.0)
|
77
|
+
rspec-expectations (>= 3.0.0)
|
78
|
+
rspec-mocks (3.4.1)
|
79
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
+
rspec-support (~> 3.4.0)
|
81
|
+
rspec-support (3.4.1)
|
82
|
+
simplecov (0.11.2)
|
83
|
+
docile (~> 1.1.0)
|
84
|
+
json (~> 1.8)
|
85
|
+
simplecov-html (~> 0.10.0)
|
86
|
+
simplecov-html (0.10.0)
|
87
|
+
sqlite3 (1.3.12)
|
88
|
+
thor (0.19.1)
|
89
|
+
thread_safe (0.3.5)
|
90
|
+
thread_safe (0.3.5-java)
|
91
|
+
timecop (0.8.0)
|
92
|
+
tzinfo (1.2.2)
|
93
|
+
thread_safe (~> 0.1)
|
94
|
+
yard (0.8.7.6)
|
71
95
|
|
72
96
|
PLATFORMS
|
73
97
|
java
|
74
98
|
ruby
|
75
99
|
|
76
100
|
DEPENDENCIES
|
77
|
-
activerecord
|
78
|
-
|
101
|
+
activerecord (>= 3.0.0)
|
102
|
+
activerecord-jdbcsqlite3-adapter
|
103
|
+
appraisal (~> 2.1.0)
|
79
104
|
aruba
|
80
|
-
|
81
|
-
cucumber (~> 1.2.1)
|
105
|
+
cucumber (~> 1.3.15)
|
82
106
|
factory_girl!
|
83
|
-
|
84
|
-
rspec (~>
|
107
|
+
jdbc-sqlite3
|
108
|
+
rspec (~> 3.0)
|
109
|
+
rspec-its (~> 1.0)
|
85
110
|
simplecov
|
86
|
-
sqlite3
|
111
|
+
sqlite3 (~> 1.3.10)
|
87
112
|
timecop
|
88
113
|
yard
|
114
|
+
|
115
|
+
BUNDLED WITH
|
116
|
+
1.15.4
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2008-
|
1
|
+
Copyright (c) 2008-2016 Joe Ferris and thoughtbot, inc.
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/NAME.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Why is this project called "Factory Girl"?
|
2
|
+
|
3
|
+
The name "Factory Girl" might be confusing to some developers who encounter this
|
4
|
+
library.
|
5
|
+
|
6
|
+
[We chose the name](https://robots.thoughtbot.com/waiting-for-a-factory-girl) as
|
7
|
+
a nod in the direction of the [Factory method](https://en.wikipedia.org/wiki/Factory_method_pattern)
|
8
|
+
and [Object Mother](http://martinfowler.com/bliki/ObjectMother.html) software
|
9
|
+
patterns from the _Design Patterns_ book, and as a reference to the
|
10
|
+
[Rolling Stones song](https://www.youtube.com/watch?v=4jKix2DFlnA) of the same
|
11
|
+
name.
|
data/NEWS
CHANGED
@@ -1,3 +1,45 @@
|
|
1
|
+
4.8.1 (September 28, 2017)
|
2
|
+
Explicitly define `#destroyed?` within the `Stub` strategy to return `nil` instead of raising
|
3
|
+
Update various dependencies
|
4
|
+
Update internal test suite to use RSpec's mocking/stubbing instead of mocha
|
5
|
+
|
6
|
+
4.8.0 (December 16, 2016)
|
7
|
+
Improve documentation
|
8
|
+
Add `FactoryGirl.generate_list` to be consistent with `build_list`/`create_list` and friends
|
9
|
+
Add `FactoryGirl.use_parent_strategy` configuration to allow associations to leverage parent build strategy
|
10
|
+
|
11
|
+
4.7.0 (April 1, 2016)
|
12
|
+
Improve documentation
|
13
|
+
Improve instrumentation payload to include traits, overrides, and the factory itself
|
14
|
+
Allow linting of traits
|
15
|
+
Deprecate factory lookup by class name in preparation for 5.0
|
16
|
+
Improve internal performance by using flat_map instead of map and compact
|
17
|
+
Improve handling of dirty attributes after building a stubbed object
|
18
|
+
Reduce warnings from redefining methods
|
19
|
+
|
20
|
+
4.6.0 (skipped)
|
21
|
+
|
22
|
+
4.5.0 (October 17, 2014)
|
23
|
+
Improve FactoryGirl.lint by including exception and message in output
|
24
|
+
Allow selective linting
|
25
|
+
Use more explicit #public_send when doing attribute assignment
|
26
|
+
Improve documentation around FactoryGirl.lint and initialize_with
|
27
|
+
Deprecate #ignore in favor of #transient
|
28
|
+
|
29
|
+
4.4.0 (February 10, 2014)
|
30
|
+
Add FactoryGirl.lint
|
31
|
+
Fix memory leak in duplicate traits
|
32
|
+
Update documentation
|
33
|
+
|
34
|
+
4.3.0 (November 3, 2013)
|
35
|
+
Start testing against Rails 4.0 and Ruby 2.0.0
|
36
|
+
Stop testing against Rails 3.0 and Ruby 1.9.2
|
37
|
+
Add *_pair methods to only build two objects
|
38
|
+
Raise if a method is defined with a FactoryGirl block (factory or trait)
|
39
|
+
Allow use of Symbol#to_proc in callbacks
|
40
|
+
Add global callbacks
|
41
|
+
Improve GETTING_STARTED and README
|
42
|
+
|
1
43
|
4.2.0 (January 18, 2013)
|
2
44
|
Improve documentation
|
3
45
|
Allow *_list syntax methods to accept a block
|
@@ -92,7 +134,7 @@
|
|
92
134
|
|
93
135
|
2.6.3 (March 9, 2012)
|
94
136
|
Fix issue with traits not being present the first time a factory is accessed
|
95
|
-
Update available Cucumber step definitions to not require a
|
137
|
+
Update available Cucumber step definitions to not require a trailing colon
|
96
138
|
when building a table of attributes to instantiate records with
|
97
139
|
|
98
140
|
2.6.2 (March 9, 2012)
|
data/README.md
CHANGED
@@ -1,74 +1,98 @@
|
|
1
|
-
# factory_girl [![Build Status](https://
|
1
|
+
# factory_girl [![Build Status](https://travis-ci.org/thoughtbot/factory_girl.svg)](http://travis-ci.org/thoughtbot/factory_girl?branch=master) [![Dependency Status](https://gemnasium.com/thoughtbot/factory_girl.svg)](https://gemnasium.com/thoughtbot/factory_girl) [![Code Climate](https://codeclimate.com/github/thoughtbot/factory_girl/badges/gpa.svg)](https://codeclimate.com/github/thoughtbot/factory_girl)
|
2
2
|
|
3
3
|
factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
|
4
4
|
|
5
5
|
If you want to use factory_girl with Rails, see
|
6
6
|
[factory_girl_rails](https://github.com/thoughtbot/factory_girl_rails).
|
7
7
|
|
8
|
+
_[Interested in the project name?](NAME.md)._
|
9
|
+
|
8
10
|
Documentation
|
9
11
|
-------------
|
10
12
|
|
11
13
|
You should find the documentation for your version of factory_girl on [Rubygems](https://rubygems.org/gems/factory_girl).
|
12
14
|
|
13
|
-
See [GETTING_STARTED]
|
15
|
+
See [GETTING_STARTED] for information on defining and using factories. We also
|
16
|
+
have [a detailed introductory video][], available for free on Upcase.
|
17
|
+
|
18
|
+
[a detailed introductory video]: https://upcase.com/videos/factory-girl?utm_source=github&utm_medium=open-source&utm_campaign=factory-girl
|
14
19
|
|
15
20
|
Install
|
16
21
|
--------
|
17
22
|
|
18
|
-
|
19
|
-
gem install factory_girl
|
20
|
-
```
|
21
|
-
or add the following line to Gemfile:
|
23
|
+
Add the following line to Gemfile:
|
22
24
|
|
23
25
|
```ruby
|
24
26
|
gem 'factory_girl'
|
25
27
|
```
|
28
|
+
|
26
29
|
and run `bundle install` from your shell.
|
27
30
|
|
31
|
+
To install the gem manually from your shell, run:
|
32
|
+
|
33
|
+
```shell
|
34
|
+
gem install factory_girl
|
35
|
+
```
|
36
|
+
|
37
|
+
**Caveat:** As of ActiveSupport 5.0 and above, Ruby 2.2.2+ is required. Because
|
38
|
+
of Rubygems' dependency resolution when installing gems, you may see an error
|
39
|
+
similar to:
|
40
|
+
|
41
|
+
```
|
42
|
+
$ gem install factory_girl
|
43
|
+
ERROR: Error installing factory_girl:
|
44
|
+
activesupport requires Ruby version >= 2.2.2.
|
45
|
+
```
|
46
|
+
|
47
|
+
To bypass this, install a pre-5.0 version of ActiveSupport before installing
|
48
|
+
manually.
|
49
|
+
|
28
50
|
Supported Ruby versions
|
29
51
|
-----------------------
|
30
52
|
|
31
|
-
The
|
32
|
-
3.6+ supports JRuby 1.6.7.2+ while running in 1.9 mode. See
|
33
|
-
[GETTING_STARTED](https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md)
|
53
|
+
The factory_girl 3.x+ series supports MRI Ruby 1.9. Additionally, factory_girl
|
54
|
+
3.6+ supports JRuby 1.6.7.2+ while running in 1.9 mode. See [GETTING_STARTED]
|
34
55
|
for more information on configuring the JRuby environment.
|
35
56
|
|
36
|
-
For versions of Ruby prior to 1.9, please use
|
57
|
+
For versions of Ruby prior to 1.9, please use factory_girl 2.x.
|
37
58
|
|
38
59
|
More Information
|
39
60
|
----------------
|
40
61
|
|
41
62
|
* [Rubygems](https://rubygems.org/gems/factory_girl)
|
42
|
-
* [
|
63
|
+
* [Stack Overflow](http://stackoverflow.com/questions/tagged/factory-girl)
|
43
64
|
* [Issues](https://github.com/thoughtbot/factory_girl/issues)
|
44
65
|
* [GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS](http://robots.thoughtbot.com/)
|
45
66
|
|
67
|
+
[GETTING_STARTED]: http://rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md
|
68
|
+
|
46
69
|
Contributing
|
47
70
|
------------
|
48
71
|
|
49
|
-
Please see
|
72
|
+
Please see [CONTRIBUTING.md](https://github.com/thoughtbot/factory_girl/blob/master/CONTRIBUTING.md).
|
50
73
|
|
51
|
-
|
52
|
-
|
74
|
+
factory_girl was originally written by Joe Ferris and is now maintained by Josh
|
75
|
+
Clayton. Many improvements and bugfixes were contributed by the [open source
|
76
|
+
community](https://github.com/thoughtbot/factory_girl/graphs/contributors).
|
53
77
|
|
54
|
-
|
78
|
+
License
|
79
|
+
-------
|
55
80
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
* Josh Nichols
|
60
|
-
* Josh Owens
|
61
|
-
* Nate Sutton
|
62
|
-
* Josh Clayton
|
63
|
-
* Thomas Walpole
|
81
|
+
factory_girl is Copyright © 2008-2016 Joe Ferris and thoughtbot. It is free
|
82
|
+
software, and may be redistributed under the terms specified in the
|
83
|
+
[LICENSE](/LICENSE) file.
|
64
84
|
|
65
|
-
|
85
|
+
About thoughtbot
|
86
|
+
----------------
|
66
87
|
|
67
|
-
|
88
|
+
![thoughtbot](http://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg)
|
68
89
|
|
90
|
+
factory_girl is maintained and funded by thoughtbot, inc.
|
69
91
|
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
70
92
|
|
71
|
-
|
72
|
-
|
93
|
+
We love open source software!
|
94
|
+
See [our other projects][community] or
|
95
|
+
[hire us][hire] to design, develop, and grow your product.
|
73
96
|
|
74
|
-
|
97
|
+
[community]: https://thoughtbot.com/community?utm_source=github
|
98
|
+
[hire]: https://thoughtbot.com?utm_source=github
|
data/Rakefile
CHANGED
@@ -9,9 +9,7 @@ require 'cucumber/rake/task'
|
|
9
9
|
Bundler::GemHelper.install_tasks
|
10
10
|
|
11
11
|
desc 'Default: run the specs and features.'
|
12
|
-
task :
|
13
|
-
system("bundle exec rake -s appraisal spec:acceptance features;")
|
14
|
-
end
|
12
|
+
task default: %w(spec:unit spec:acceptance features)
|
15
13
|
|
16
14
|
namespace :spec do
|
17
15
|
desc "Run unit specs"
|
data/factory_girl.gemspec
CHANGED
@@ -10,10 +10,9 @@ Gem::Specification.new do |s|
|
|
10
10
|
using factories - less error-prone, more explicit, and
|
11
11
|
all-around easier to work with than fixtures.}
|
12
12
|
|
13
|
-
s.files = `git ls-files`.split("\n")
|
14
|
-
s.test_files = `git ls-files -- Appraisals {spec,features,gemfiles}/*`.split("\n")
|
13
|
+
s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(spec|features)/}) }
|
15
14
|
|
16
|
-
s.
|
15
|
+
s.require_path = 'lib'
|
17
16
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
18
17
|
|
19
18
|
s.authors = ["Josh Clayton", "Joe Ferris"]
|
@@ -23,22 +22,15 @@ Gem::Specification.new do |s|
|
|
23
22
|
|
24
23
|
s.add_dependency("activesupport", ">= 3.0.0")
|
25
24
|
|
26
|
-
s.add_development_dependency("rspec", "~>
|
27
|
-
s.add_development_dependency("
|
25
|
+
s.add_development_dependency("rspec", "~> 3.0")
|
26
|
+
s.add_development_dependency("rspec-its", "~> 1.0")
|
27
|
+
s.add_development_dependency("cucumber", "~> 1.3.15")
|
28
28
|
s.add_development_dependency("timecop")
|
29
29
|
s.add_development_dependency("simplecov")
|
30
30
|
s.add_development_dependency("aruba")
|
31
|
-
s.add_development_dependency("
|
32
|
-
s.add_development_dependency("
|
33
|
-
s.add_development_dependency("appraisal", "~> 0.5.1")
|
34
|
-
|
35
|
-
if RUBY_PLATFORM == "java"
|
36
|
-
s.add_development_dependency("activerecord-jdbcsqlite3-adapter")
|
37
|
-
s.add_development_dependency("jdbc-sqlite3")
|
38
|
-
else
|
39
|
-
s.add_development_dependency("sqlite3")
|
40
|
-
end
|
41
|
-
|
31
|
+
s.add_development_dependency("appraisal", "~> 2.1.0")
|
32
|
+
s.add_development_dependency("activerecord", ">= 3.0.0")
|
42
33
|
s.add_development_dependency("yard")
|
43
|
-
end
|
44
34
|
|
35
|
+
s.license = "MIT"
|
36
|
+
end
|
data/gemfiles/3.2.gemfile
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# This file was generated by Appraisal
|
2
2
|
|
3
|
-
source "
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "activerecord",
|
5
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
6
|
+
gem "jdbc-sqlite3", :platforms => :jruby
|
7
|
+
gem "sqlite3", "~> 1.3.10", :platforms => :ruby
|
8
|
+
gem "activerecord", :git => "https://github.com/rails/rails.git", :branch => "3-2-stable"
|
6
9
|
|
7
|
-
gemspec :path=>"../"
|
10
|
+
gemspec :path => "../"
|
data/gemfiles/3.2.gemfile.lock
CHANGED
@@ -1,82 +1,105 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/rails/rails.git
|
3
|
+
revision: e17e25cd23e8abd45b1706463dd57c90fa6dcb7c
|
4
|
+
branch: 3-2-stable
|
5
|
+
specs:
|
6
|
+
activemodel (3.2.22.5)
|
7
|
+
activesupport (= 3.2.22.5)
|
8
|
+
builder (~> 3.0)
|
9
|
+
activerecord (3.2.22.5)
|
10
|
+
activemodel (= 3.2.22.5)
|
11
|
+
activesupport (= 3.2.22.5)
|
12
|
+
arel (~> 3.0.2)
|
13
|
+
tzinfo (~> 0.3.29)
|
14
|
+
activesupport (3.2.22.5)
|
15
|
+
i18n (~> 0.6, >= 0.6.4)
|
16
|
+
multi_json (~> 1.0)
|
17
|
+
|
1
18
|
PATH
|
2
|
-
remote:
|
19
|
+
remote: ../
|
3
20
|
specs:
|
4
|
-
factory_girl (4.
|
21
|
+
factory_girl (4.8.1)
|
5
22
|
activesupport (>= 3.0.0)
|
6
23
|
|
7
24
|
GEM
|
8
|
-
remote:
|
25
|
+
remote: https://rubygems.org/
|
9
26
|
specs:
|
10
|
-
|
11
|
-
activesupport (= 3.2.11)
|
12
|
-
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.11)
|
14
|
-
activemodel (= 3.2.11)
|
15
|
-
activesupport (= 3.2.11)
|
16
|
-
arel (~> 3.0.2)
|
17
|
-
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.11)
|
19
|
-
i18n (~> 0.6)
|
20
|
-
multi_json (~> 1.0)
|
21
|
-
appraisal (0.5.1)
|
27
|
+
appraisal (2.1.0)
|
22
28
|
bundler
|
23
29
|
rake
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
thor (>= 0.14.0)
|
31
|
+
arel (3.0.3)
|
32
|
+
aruba (0.14.2)
|
33
|
+
childprocess (~> 0.5.6)
|
34
|
+
contracts (~> 0.9)
|
35
|
+
cucumber (>= 1.3.19)
|
36
|
+
ffi (~> 1.9.10)
|
37
|
+
rspec-expectations (>= 2.99)
|
38
|
+
thor (~> 0.19)
|
39
|
+
builder (3.2.3)
|
40
|
+
childprocess (0.5.9)
|
41
|
+
ffi (~> 1.0, >= 1.0.11)
|
42
|
+
contracts (0.16.0)
|
43
|
+
cucumber (1.3.20)
|
35
44
|
builder (>= 2.1.2)
|
36
45
|
diff-lcs (>= 1.1.3)
|
37
|
-
gherkin (~> 2.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
rake (
|
50
|
-
rspec (
|
51
|
-
rspec-core (~>
|
52
|
-
rspec-expectations (~>
|
53
|
-
rspec-mocks (~>
|
54
|
-
rspec-core (
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
46
|
+
gherkin (~> 2.12)
|
47
|
+
multi_json (>= 1.7.5, < 2.0)
|
48
|
+
multi_test (>= 0.1.2)
|
49
|
+
diff-lcs (1.3)
|
50
|
+
docile (1.1.5)
|
51
|
+
ffi (1.9.18)
|
52
|
+
gherkin (2.12.2)
|
53
|
+
multi_json (~> 1.3)
|
54
|
+
i18n (0.8.6)
|
55
|
+
json (2.1.0)
|
56
|
+
multi_json (1.12.2)
|
57
|
+
multi_test (0.1.2)
|
58
|
+
rake (12.1.0)
|
59
|
+
rspec (3.6.0)
|
60
|
+
rspec-core (~> 3.6.0)
|
61
|
+
rspec-expectations (~> 3.6.0)
|
62
|
+
rspec-mocks (~> 3.6.0)
|
63
|
+
rspec-core (3.6.0)
|
64
|
+
rspec-support (~> 3.6.0)
|
65
|
+
rspec-expectations (3.6.0)
|
66
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
+
rspec-support (~> 3.6.0)
|
68
|
+
rspec-its (1.2.0)
|
69
|
+
rspec-core (>= 3.0.0)
|
70
|
+
rspec-expectations (>= 3.0.0)
|
71
|
+
rspec-mocks (3.6.0)
|
72
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
+
rspec-support (~> 3.6.0)
|
74
|
+
rspec-support (3.6.0)
|
75
|
+
simplecov (0.15.1)
|
76
|
+
docile (~> 1.1.0)
|
77
|
+
json (>= 1.8, < 3)
|
78
|
+
simplecov-html (~> 0.10.0)
|
79
|
+
simplecov-html (0.10.2)
|
80
|
+
sqlite3 (1.3.13)
|
81
|
+
thor (0.20.0)
|
82
|
+
timecop (0.9.1)
|
83
|
+
tzinfo (0.3.53)
|
84
|
+
yard (0.9.9)
|
66
85
|
|
67
86
|
PLATFORMS
|
68
87
|
ruby
|
69
88
|
|
70
89
|
DEPENDENCIES
|
71
|
-
activerecord
|
72
|
-
|
90
|
+
activerecord!
|
91
|
+
activerecord-jdbcsqlite3-adapter
|
92
|
+
appraisal (~> 2.1.0)
|
73
93
|
aruba
|
74
|
-
|
75
|
-
cucumber (~> 1.2.1)
|
94
|
+
cucumber (~> 1.3.15)
|
76
95
|
factory_girl!
|
77
|
-
|
78
|
-
rspec (~>
|
96
|
+
jdbc-sqlite3
|
97
|
+
rspec (~> 3.0)
|
98
|
+
rspec-its (~> 1.0)
|
79
99
|
simplecov
|
80
|
-
sqlite3
|
100
|
+
sqlite3 (~> 1.3.10)
|
81
101
|
timecop
|
82
102
|
yard
|
103
|
+
|
104
|
+
BUNDLED WITH
|
105
|
+
1.15.4
|
data/gemfiles/4.0.gemfile
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# This file was generated by Appraisal
|
2
2
|
|
3
|
-
source "
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "activerecord", :
|
5
|
+
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
6
|
+
gem "jdbc-sqlite3", :platforms => :jruby
|
7
|
+
gem "sqlite3", "~> 1.3.10", :platforms => :ruby
|
8
|
+
gem "activerecord", "~> 4.0.13"
|
6
9
|
|
7
|
-
gemspec :path=>"../"
|
10
|
+
gemspec :path => "../"
|