fixture_factory 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: 9970ff1a9b9427593019d53a7ae239fe9752651b9a8a8d15b684ecac2d041c93
4
- data.tar.gz: 1842a6092e09ff6d64f25630d0c0a725c49315d2664629b1af0651935ac0970d
3
+ metadata.gz: 2400bfa9a06b737fc0c45a0923573c98d5e212fc8819830259032b1dff5c8f4f
4
+ data.tar.gz: f7188d3a67f00d1274105c200b569739c913c8b8b26c3d14418b9effd7bf0d6e
5
5
  SHA512:
6
- metadata.gz: a5aa2e004aeabda9c7472c1e159f823b8d97ae8e9d094e82f96fbf4838270ee1f04a69172471f8dd9cc37712d4efe6ce4359e3994e9dd35b534a1982978ec248
7
- data.tar.gz: c9533a232a9c28dd4d6ecb8356af3f49868b265766780c9d5fb4c29dc7a089907c97b45b7ba06e03d1bb498f0848d6e18245983861bd0d4efa266417939e0e88
6
+ metadata.gz: 778d52104a7364044668361062da829a01dd69b6532da5ce7c8e4c336001ad92820bac847d6fe2b253b98a65eb8b1f7c027d084f46d97e3d2de86789c4c290e8
7
+ data.tar.gz: 4970561723810fd451f93cd32f63f77209454cb9f576ad79ba7e5803345f322cdebe3e9695fdd4ae93c43da09fec147bbcf21831a62b65b70c293043c4dfc75c
@@ -32,7 +32,7 @@ module FixtureFactory
32
32
  def klass=(new_class)
33
33
  @klass = case new_class
34
34
  when String
35
- new_class.to_s.constantize # rubocop:disable Sorbet/ConstantsFromStrings
35
+ new_class.to_s.constantize
36
36
  else
37
37
  new_class
38
38
  end
@@ -36,16 +36,16 @@ module FixtureFactory
36
36
  # === Example
37
37
  #
38
38
  # define_factories do
39
- # fixture(:user, like: :bob)
40
- # fixture(:active_user, parent: :user) do
39
+ # factory(:user, like: :bob)
40
+ # factory(:active_user, parent: :user) do
41
41
  # { active: true }
42
42
  # end
43
- # fixture(:cool_user, class: 'User') do
43
+ # factory(:cool_user, class: 'User') do
44
44
  # { status: :cool }
45
45
  # end
46
- # fixture(:admin, via: :users, like: :bob_admin, class: 'User')
46
+ # factory(:admin, via: :users, like: :bob_admin, class: 'User')
47
47
  # end
48
- def fixture(name, options = {}, &block)
48
+ def factory(name, options = {}, &block)
49
49
  parent = all_factory_definitions[options[:parent]]
50
50
  options[:parent] = parent if options.key?(:parent)
51
51
  options[:block] = block if block
@@ -59,12 +59,12 @@ module FixtureFactory
59
59
  #
60
60
  # class SomeTest < ActiveSupport::TestCase
61
61
  # define_factories do
62
- # fixture(:blog)
62
+ # factory(:blog)
63
63
  # end
64
64
  # end
65
65
  #
66
66
  # SomeTest.define_factories do
67
- # fixture(:post)
67
+ # factory(:post)
68
68
  # end
69
69
  def define_factories(&block)
70
70
  self.fixture_factory_definitions = {}.with_indifferent_access
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FixtureFactory
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixture_factory
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
  - Shopify Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-06 00:00:00.000000000 Z
11
+ date: 2020-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -137,7 +137,8 @@ files:
137
137
  - lib/fixture_factory/sequence.rb
138
138
  - lib/fixture_factory/version.rb
139
139
  homepage:
140
- licenses: []
140
+ licenses:
141
+ - MIT
141
142
  metadata: {}
142
143
  post_install_message:
143
144
  rdoc_options: []