ffactory_girl 4.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +9 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +2 -0
  5. data/.simplecov +4 -0
  6. data/.travis.yml +38 -0
  7. data/.yardopts +5 -0
  8. data/Appraisals +19 -0
  9. data/CONTRIBUTING.md +60 -0
  10. data/GETTING_STARTED.md +1391 -0
  11. data/Gemfile +8 -0
  12. data/Gemfile.lock +116 -0
  13. data/LICENSE +19 -0
  14. data/NAME.md +11 -0
  15. data/NEWS +290 -0
  16. data/README.md +98 -0
  17. data/Rakefile +36 -0
  18. data/cucumber.yml +1 -0
  19. data/factory_girl.gemspec +36 -0
  20. data/gemfiles/3.2.gemfile +10 -0
  21. data/gemfiles/3.2.gemfile.lock +105 -0
  22. data/gemfiles/4.0.gemfile +10 -0
  23. data/gemfiles/4.0.gemfile.lock +105 -0
  24. data/gemfiles/4.1.gemfile +10 -0
  25. data/gemfiles/4.1.gemfile.lock +104 -0
  26. data/gemfiles/4.2.gemfile +10 -0
  27. data/gemfiles/4.2.gemfile.lock +104 -0
  28. data/gemfiles/5.0.gemfile +10 -0
  29. data/gemfiles/5.0.gemfile.lock +103 -0
  30. data/lib/factory_girl/aliases.rb +18 -0
  31. data/lib/factory_girl/attribute/association.rb +27 -0
  32. data/lib/factory_girl/attribute/dynamic.rb +24 -0
  33. data/lib/factory_girl/attribute/sequence.rb +16 -0
  34. data/lib/factory_girl/attribute/static.rb +16 -0
  35. data/lib/factory_girl/attribute.rb +62 -0
  36. data/lib/factory_girl/attribute_assigner.rb +97 -0
  37. data/lib/factory_girl/attribute_list.rb +67 -0
  38. data/lib/factory_girl/callback.rb +40 -0
  39. data/lib/factory_girl/callbacks_observer.rb +21 -0
  40. data/lib/factory_girl/configuration.rb +37 -0
  41. data/lib/factory_girl/declaration/association.rb +28 -0
  42. data/lib/factory_girl/declaration/dynamic.rb +26 -0
  43. data/lib/factory_girl/declaration/implicit.rb +33 -0
  44. data/lib/factory_girl/declaration/static.rb +26 -0
  45. data/lib/factory_girl/declaration.rb +23 -0
  46. data/lib/factory_girl/declaration_list.rb +49 -0
  47. data/lib/factory_girl/decorator/attribute_hash.rb +16 -0
  48. data/lib/factory_girl/decorator/class_key_hash.rb +28 -0
  49. data/lib/factory_girl/decorator/disallows_duplicates_registry.rb +13 -0
  50. data/lib/factory_girl/decorator/invocation_tracker.rb +19 -0
  51. data/lib/factory_girl/decorator/new_constructor.rb +12 -0
  52. data/lib/factory_girl/decorator.rb +21 -0
  53. data/lib/factory_girl/definition.rb +136 -0
  54. data/lib/factory_girl/definition_hierarchy.rb +48 -0
  55. data/lib/factory_girl/definition_proxy.rb +174 -0
  56. data/lib/factory_girl/errors.rb +25 -0
  57. data/lib/factory_girl/evaluation.rb +27 -0
  58. data/lib/factory_girl/evaluator.rb +82 -0
  59. data/lib/factory_girl/evaluator_class_definer.rb +20 -0
  60. data/lib/factory_girl/factory.rb +163 -0
  61. data/lib/factory_girl/factory_runner.rb +33 -0
  62. data/lib/factory_girl/find_definitions.rb +25 -0
  63. data/lib/factory_girl/linter.rb +97 -0
  64. data/lib/factory_girl/null_factory.rb +18 -0
  65. data/lib/factory_girl/null_object.rb +24 -0
  66. data/lib/factory_girl/registry.rb +38 -0
  67. data/lib/factory_girl/reload.rb +8 -0
  68. data/lib/factory_girl/sequence.rb +62 -0
  69. data/lib/factory_girl/strategy/attributes_for.rb +13 -0
  70. data/lib/factory_girl/strategy/build.rb +15 -0
  71. data/lib/factory_girl/strategy/create.rb +18 -0
  72. data/lib/factory_girl/strategy/null.rb +11 -0
  73. data/lib/factory_girl/strategy/stub.rb +111 -0
  74. data/lib/factory_girl/strategy_calculator.rb +26 -0
  75. data/lib/factory_girl/strategy_syntax_method_registrar.rb +54 -0
  76. data/lib/factory_girl/syntax/default.rb +76 -0
  77. data/lib/factory_girl/syntax/methods.rb +111 -0
  78. data/lib/factory_girl/syntax.rb +7 -0
  79. data/lib/factory_girl/syntax_runner.rb +6 -0
  80. data/lib/factory_girl/trait.rb +30 -0
  81. data/lib/factory_girl/version.rb +3 -0
  82. data/lib/factory_girl.rb +156 -0
  83. metadata +271 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cb287707bc2fbbf272e047325e77dc68d11ab27f
4
+ data.tar.gz: 458324240a8fde9237076db86abede0bf32649cd
5
+ SHA512:
6
+ metadata.gz: 3a20da4b70193013c70e9c8ad4fbbdc82f56724a8b047e021f3aa68f3125fd3bc81b51d76416581ad7b32331cec695f7c64733dcf89229e7c1b6f4ddcea71dcf
7
+ data.tar.gz: 7113777ca56b419d96c19f022d2cff6588cdbda5fccafdc720fbde63af649094e3f296b9bbd400eb8026ed04b19fc151c019a0becdc5a332225ba57210b1860d
data/.autotest ADDED
@@ -0,0 +1,9 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ at.clear_mappings
3
+
4
+ at.add_mapping(%r{^test/.*_test\.rb$}) {|f, _| [f] }
5
+ at.add_mapping(%r{^lib/factory_girl/(.*)\.rb$}) {|_, m| ["test/#{m[1]}_test.rb",
6
+ "test/integration_test.rb"] }
7
+ at.add_mapping(%r{^test/(test_helper|models)\.rb$}) { at.files_matching %r{^test/.*_test\.rb$} }
8
+ at.add_mapping(%r{^lib/.*\.rb$}) { at.files_matching %r{^test/.*_test\.rb$} }
9
+ end
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ *.swp
2
+ test.db
3
+ factory_girl-*.gem
4
+ doc
5
+ .yardoc
6
+ coverage
7
+ .bundle
8
+ tmp
9
+ bin
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format progress
2
+ --color
data/.simplecov ADDED
@@ -0,0 +1,4 @@
1
+ SimpleCov.start do
2
+ add_filter "/spec/"
3
+ add_filter "/tmp/"
4
+ end
data/.travis.yml ADDED
@@ -0,0 +1,38 @@
1
+ rvm:
2
+ - 1.9.3
3
+ - 2.0.0
4
+ - 2.1.9
5
+ - 2.2.5
6
+ - 2.3.1
7
+ - ruby-head
8
+ - rbx-2
9
+ before_install:
10
+ - gem update --system
11
+ - gem update bundler
12
+ - gem cleanup bundler
13
+ install: "bundle install --jobs 8"
14
+ script: "bundle exec rake"
15
+ gemfile:
16
+ - gemfiles/3.2.gemfile
17
+ - gemfiles/4.0.gemfile
18
+ - gemfiles/4.1.gemfile
19
+ - gemfiles/4.2.gemfile
20
+ - gemfiles/5.0.gemfile
21
+ matrix:
22
+ fast_finish: true
23
+ exclude:
24
+ - rvm: 1.9.3
25
+ gemfile: gemfiles/5.0.gemfile
26
+ - rvm: 2.0.0
27
+ gemfile: gemfiles/5.0.gemfile
28
+ - rvm: 2.1.9
29
+ gemfile: gemfiles/5.0.gemfile
30
+ allow_failures:
31
+ - rvm: ruby-head
32
+ - rvm: rbx-2
33
+ branches:
34
+ only:
35
+ - master
36
+
37
+ sudo: false
38
+ cache: bundler
data/.yardopts ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ -
3
+ GETTING_STARTED.md
4
+ CONTRIBUTING.md
5
+ LICENSE
data/Appraisals ADDED
@@ -0,0 +1,19 @@
1
+ appraise "3.2" do
2
+ gem "activerecord", git: 'https://github.com/rails/rails.git', branch: '3-2-stable'
3
+ end
4
+
5
+ appraise '4.0' do
6
+ gem 'activerecord', "~> 4.0.13"
7
+ end
8
+
9
+ appraise '4.1' do
10
+ gem 'activerecord', "~> 4.1.14"
11
+ end
12
+
13
+ appraise '4.2' do
14
+ gem 'activerecord', "~> 4.2.5.1"
15
+ end
16
+
17
+ appraise '5.0' do
18
+ gem 'activerecord', "~> 5.0.0"
19
+ end
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,60 @@
1
+ # Contributing to Factory Girl
2
+
3
+ We love pull requests from everyone. By participating in this project, you
4
+ agree to abide by the thoughtbot [code of conduct].
5
+
6
+ [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
7
+
8
+ Here are some ways *you* can contribute:
9
+
10
+ * by using alpha, beta, and prerelease versions
11
+ * by reporting bugs
12
+ * by suggesting new features
13
+ * by writing or editing documentation
14
+ * by writing specifications
15
+ * by writing code ( **no patch is too small** : fix typos, add comments, clean up inconsistent whitespace )
16
+ * by refactoring code
17
+ * by closing [issues][]
18
+ * by reviewing patches
19
+
20
+ [issues]: https://github.com/thoughtbot/factory_girl/issues
21
+
22
+ ## Submitting an Issue
23
+
24
+ * We use the [GitHub issue tracker][issues] to track bugs and features.
25
+ * Before submitting a bug report or feature request, check to make sure it hasn't
26
+ already been submitted.
27
+ * When submitting a bug report, please include a [Gist][] that includes a stack
28
+ trace and any details that may be necessary to reproduce the bug, including
29
+ your gem version, Ruby version, and operating system. Ideally, a bug report
30
+ should include a pull request with failing specs.
31
+
32
+ [gist]: https://gist.github.com/
33
+
34
+ ## Cleaning up issues
35
+
36
+ * Issues that have no response from the submitter will be closed after 30 days.
37
+ * Issues will be closed once they're assumed to be fixed or answered. If the
38
+ maintainer is wrong, it can be opened again.
39
+ * If your issue is closed by mistake, please understand and explain the issue.
40
+ We will happily reopen the issue.
41
+
42
+ ## Submitting a Pull Request
43
+ 1. [Fork][fork] the [official repository][repo].
44
+ 2. [Create a topic branch.][branch]
45
+ 3. Implement your feature or bug fix.
46
+ 4. Add, commit, and push your changes.
47
+ 5. [Submit a pull request.][pr]
48
+
49
+ ## Notes
50
+ * Please add tests if you changed code. Contributions without tests won't be accepted.
51
+ * If you don't know how to add tests, please put in a PR and leave a comment
52
+ asking for help. We love helping!
53
+ * Please don't update the Gem version.
54
+
55
+ [repo]: https://github.com/thoughtbot/factory_girl/tree/master
56
+ [fork]: https://help.github.com/articles/fork-a-repo/
57
+ [branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
58
+ [pr]: https://help.github.com/articles/using-pull-requests/
59
+
60
+ Inspired by https://github.com/middleman/middleman-heroku/blob/master/CONTRIBUTING.md