factory_strategist 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: 72156c528e7c26354b741bcd6e9774a9115b55098fb66b4cbcab6df0395b3235
4
- data.tar.gz: e76bb500a3e4ee0828a1347f6282262ffe39a38e8ffe40e9b42596c38116736c
3
+ metadata.gz: 83f33524068913a52ed377f0ba677ddf8e669598a0d2a679ee939ee91d540120
4
+ data.tar.gz: 0c5b55ccc8d6799c2f46f3cdb30630aa68e60300104e9b4499dd5317c8e0e88a
5
5
  SHA512:
6
- metadata.gz: 50e11e52cfbf2337ffba95aa6287ac0c32067a77476802ec0ec6cbe98035b443acb6fbcbfb311a658100ea71392bd19c65cdbdcf8693b6e6b196f7612bf4ac04
7
- data.tar.gz: 6d7ba24c1bc541e824d66f588a73ef295ea46506b433ff3363f06d5c7d239cbd382a189386d3729f7ca13e7b4d0675c4f29fb206dc914a682713788676f8d452
6
+ metadata.gz: f65c98e670a0e64af242e1c7ba4bf4e3c4ebf16a08457bcad97bf657f1b311ecae196f758e9b03587161d6ff26e72dacdbec1147d328425362495284788af743
7
+ data.tar.gz: d545034207063763fcf086b92b2dccafa1aeaf1faf4ce736f31d6a50ff84341fa92b58ce551563c2b6284111761122248bbba777cb298380476ce565d7bae4bc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2021-08-22
3
+ ## [0.2.0] - 2021-09-26
4
4
 
5
- - Initial release
5
+ - Add environment variable: `FATORYSTRATEGIST` to apply configuration this gem expands
6
+
7
+ ## [0.1.0] - 2021-09-24
8
+
9
+ - Verify if called `FactoryBot.create` is replacable to `FactoryBot.build_stubbed` by alias
data/Gemfile.lock CHANGED
@@ -2,23 +2,12 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  factory_strategist (0.1.0)
5
+ factory_bot
6
+ rspec
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
8
10
  specs:
9
- actionpack (6.1.4.1)
10
- actionview (= 6.1.4.1)
11
- activesupport (= 6.1.4.1)
12
- rack (~> 2.0, >= 2.0.9)
13
- rack-test (>= 0.6.3)
14
- rails-dom-testing (~> 2.0)
15
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
16
- actionview (6.1.4.1)
17
- activesupport (= 6.1.4.1)
18
- builder (~> 3.1)
19
- erubi (~> 1.4)
20
- rails-dom-testing (~> 2.0)
21
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
11
  activesupport (6.1.4.1)
23
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
13
  i18n (>= 1.6, < 2)
@@ -26,42 +15,16 @@ GEM
26
15
  tzinfo (~> 2.0)
27
16
  zeitwerk (~> 2.3)
28
17
  ast (2.4.2)
29
- builder (3.2.4)
30
18
  concurrent-ruby (1.1.9)
31
- crass (1.0.6)
32
19
  diff-lcs (1.4.4)
33
- erubi (1.10.0)
34
20
  factory_bot (6.2.0)
35
21
  activesupport (>= 5.0.0)
36
22
  i18n (1.8.10)
37
23
  concurrent-ruby (~> 1.0)
38
- loofah (2.12.0)
39
- crass (~> 1.0.2)
40
- nokogiri (>= 1.5.9)
41
- method_source (1.0.0)
42
24
  minitest (5.14.4)
43
- nokogiri (1.12.4-x86_64-darwin)
44
- racc (~> 1.4)
45
- nokogiri (1.12.4-x86_64-linux)
46
- racc (~> 1.4)
47
25
  parallel (1.20.1)
48
26
  parser (3.0.2.0)
49
27
  ast (~> 2.4.1)
50
- racc (1.5.2)
51
- rack (2.2.3)
52
- rack-test (1.1.0)
53
- rack (>= 1.0, < 3)
54
- rails-dom-testing (2.0.3)
55
- activesupport (>= 4.2.0)
56
- nokogiri (>= 1.6)
57
- rails-html-sanitizer (1.4.2)
58
- loofah (~> 2.3)
59
- railties (6.1.4.1)
60
- actionpack (= 6.1.4.1)
61
- activesupport (= 6.1.4.1)
62
- method_source
63
- rake (>= 0.13)
64
- thor (~> 1.0)
65
28
  rainbow (3.0.0)
66
29
  rake (13.0.6)
67
30
  regexp_parser (2.1.1)
@@ -78,14 +41,6 @@ GEM
78
41
  rspec-mocks (3.10.2)
79
42
  diff-lcs (>= 1.2.0, < 2.0)
80
43
  rspec-support (~> 3.10.0)
81
- rspec-rails (5.0.2)
82
- actionpack (>= 5.2)
83
- activesupport (>= 5.2)
84
- railties (>= 5.2)
85
- rspec-core (~> 3.10)
86
- rspec-expectations (~> 3.10)
87
- rspec-mocks (~> 3.10)
88
- rspec-support (~> 3.10)
89
44
  rspec-support (3.10.2)
90
45
  rubocop (1.20.0)
91
46
  parallel (~> 1.10)
@@ -104,7 +59,6 @@ GEM
104
59
  rubocop (~> 1.0)
105
60
  rubocop-ast (>= 1.1.0)
106
61
  ruby-progressbar (1.11.0)
107
- thor (1.1.0)
108
62
  tzinfo (2.0.4)
109
63
  concurrent-ruby (~> 1.0)
110
64
  unicode-display_width (2.0.0)
@@ -115,11 +69,9 @@ PLATFORMS
115
69
  x86_64-linux
116
70
 
117
71
  DEPENDENCIES
118
- factory_bot
119
72
  factory_strategist!
120
73
  rake (~> 13.0)
121
74
  rspec (~> 3.0)
122
- rspec-rails
123
75
  rubocop (~> 1.7)
124
76
  rubocop-rake
125
77
  rubocop-rspec
@@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  # Uncomment to register a new dependency of your gem
34
34
  # spec.add_dependency "example-gem", "~> 1.0"
35
- spec.add_development_dependency "factory_bot"
36
- spec.add_development_dependency "rspec-rails"
35
+ spec.add_dependency "factory_bot"
36
+ spec.add_dependency "rspec"
37
37
  spec.add_development_dependency "rubocop-rake"
38
38
  spec.add_development_dependency "rubocop-rspec"
39
39
 
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rspec"
4
+ require "factory_bot"
5
+ module FactoryStrategist
6
+ # Settings to see which method is best
7
+ module Configure
8
+ RSpec.configure do |config|
9
+ config.before(:suite) do |_ex|
10
+ FactoryBot::Syntax::Methods.alias_method :create, :build_stubbed
11
+ end
12
+
13
+ config.after(:example) do |ex|
14
+ case ex.exception
15
+ when RSpec::Expectations::ExpectationNotMetError
16
+ # no-op
17
+ when nil
18
+ p "#{ex.location} create can be replaced to build_stubbed"
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FactoryStrategist
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,23 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "factory_strategist/version"
4
- require "rspec"
5
- require "factory_bot"
6
-
7
- # Settings to see which method is best
8
- module FactoryStrategist
9
- RSpec.configure do |config|
10
- config.before(:suite) do |_ex|
11
- FactoryBot::Syntax::Methods.alias_method :create, :build_stubbed
12
- end
13
-
14
- config.after(:example) do |ex|
15
- case ex.exception
16
- when RSpec::Expectations::ExpectationNotMetError
17
- # no-op
18
- when nil
19
- p "#{ex.location} create can be replaced to build_stubbed"
20
- end
21
- end
22
- end
23
- end
4
+ require_relative "factory_strategist/configure" if ENV["FATORYSTRATEGIST"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_strategist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiko Kaneko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-24 00:00:00.000000000 Z
11
+ date: 2021-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: factory_bot
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -25,13 +25,13 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec-rails
28
+ name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -88,6 +88,7 @@ files:
88
88
  - bin/setup
89
89
  - factory_strategist.gemspec
90
90
  - lib/factory_strategist.rb
91
+ - lib/factory_strategist/configure.rb
91
92
  - lib/factory_strategist/version.rb
92
93
  homepage: https://github.com/neko314/factory_strategist
93
94
  licenses: