fixtury 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20c147be399a022612e1f693ee423b63813095167a2f38bd555570c037f7710e
4
- data.tar.gz: c99e8c78d0ed4171cd0957e6ea09568ef4544074799b2334bb9253eb33bac1f0
3
+ metadata.gz: eddc0719dafeefce9c31300b44475af08c14429c7b1de69328cef38fa1c6f6fb
4
+ data.tar.gz: b79ec0e74adf1bff8b1f0f03b875c5e83dde1c02856908122e03ae51c93eab9c
5
5
  SHA512:
6
- metadata.gz: dd118879f0605f0e55e2342548d9a82eb07030b7f8b7ecf88c8a58f17eea26612a24de41aa207fc01cc811d28ad884cd6f0c1ae5ff1669c445e17e67239121ed
7
- data.tar.gz: f2a5685054b47b0cb1e8d463502d11127914afff403cfa2b3157bb96ae2df07f20b1480b6b281d56eaa76f0ecc272b0f012594415842c220abe873d8c7b2cf58
6
+ metadata.gz: 33daa75ff819a5a3d22cdb773fd08eb35e8859f401e83e0246c481ef2030a1438d9376eb66ab9e5db3c566da130fc46e0af56a5744b9e194ae2ce7801611fb21
7
+ data.tar.gz: 1ec5c972ed02e9760d0a064616c047d2d78d0ace61d1e9a43db0d36d54b911e2ea65ff83503e15dd1d47ec4992d55f4e8afecfdc09a0f0ba12cfaad0cf07cf0c
data/fixtury.gemspec CHANGED
@@ -15,13 +15,12 @@ Gem::Specification.new do |spec|
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+ spec.metadata["rubygems_mfa_required"] = "true"
18
19
 
19
20
  # Specify which files should be added to the gem when it is released.
20
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
- end
24
- spec.bindir = "exe"
21
+ spec.files = Dir["lib/**/*"] + Dir["*.gemspec"] + Dir["bin/**/*"]
22
+
23
+ spec.bindir = "bin"
25
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
25
  spec.require_paths = ["lib"]
27
26
 
@@ -35,5 +34,5 @@ Gem::Specification.new do |spec|
35
34
  spec.add_development_dependency "rake"
36
35
  spec.add_development_dependency "sqlite3"
37
36
 
38
- spec.required_ruby_version = ">= 3.2.0"
37
+ spec.required_ruby_version = ">= 3.3.0"
39
38
  end
@@ -3,7 +3,7 @@
3
3
  module Fixtury
4
4
 
5
5
  MAJOR = 2
6
- MINOR = 2
6
+ MINOR = 3
7
7
  PATCH = 0
8
8
  PRERELEASE = nil
9
9
 
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixtury
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -141,14 +141,6 @@ executables: []
141
141
  extensions: []
142
142
  extra_rdoc_files: []
143
143
  files:
144
- - ".github/dependabot.yml"
145
- - ".github/workflows/build.yml"
146
- - ".gitignore"
147
- - ".ruby-version"
148
- - Gemfile
149
- - Gemfile.lock
150
- - README.md
151
- - Rakefile
152
144
  - bin/console
153
145
  - bin/setup
154
146
  - fixtury.gemspec
@@ -178,6 +170,7 @@ licenses:
178
170
  - MIT
179
171
  metadata:
180
172
  allowed_push_host: https://rubygems.org
173
+ rubygems_mfa_required: 'true'
181
174
  rdoc_options: []
182
175
  require_paths:
183
176
  - lib
@@ -185,14 +178,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
178
  requirements:
186
179
  - - ">="
187
180
  - !ruby/object:Gem::Version
188
- version: 3.2.0
181
+ version: 3.3.0
189
182
  required_rubygems_version: !ruby/object:Gem::Requirement
190
183
  requirements:
191
184
  - - ">="
192
185
  - !ruby/object:Gem::Version
193
186
  version: '0'
194
187
  requirements: []
195
- rubygems_version: 3.6.7
188
+ rubygems_version: 4.0.9
196
189
  specification_version: 4
197
190
  summary: Treat fixtures like factories and factories like fixtures
198
191
  test_files: []
@@ -1,35 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "github-actions"
4
- directory: "/"
5
- open-pull-requests-limit: 20
6
- schedule:
7
- interval: "daily"
8
- time: "09:00"
9
- timezone: "America/New_York"
10
- commit-message:
11
- prefix: "[github-actions] "
12
- - package-ecosystem: "bundler"
13
- directory: "/"
14
- schedule:
15
- interval: "daily"
16
- time: "08:30"
17
- timezone: "America/New_York"
18
- allow:
19
- - dependency-type: "all"
20
- versioning-strategy: increase
21
- open-pull-requests-limit: 20
22
- insecure-external-code-execution: deny
23
- commit-message:
24
- prefix: "[bundler] "
25
- groups:
26
- monthly:
27
- patterns:
28
- - "*"
29
- ignore:
30
- - dependency-name: "activesupport"
31
- update-types: ["version-update:semver-major"]
32
- - dependency-name: "activemodel"
33
- update-types: ["version-update:semver-major"]
34
- - dependency-name: "activerecord"
35
- update-types: ["version-update:semver-major"]
@@ -1,22 +0,0 @@
1
- name: build
2
- on:
3
- pull_request:
4
- push:
5
- branches:
6
- - main
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- strategy:
11
- fail-fast: false
12
- matrix:
13
- ruby-version: [3.2, 3.3, 3.4]
14
- steps:
15
- - uses: actions/checkout@v4
16
- with:
17
- show-progress: 'false'
18
- - uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: ${{ matrix.ruby-version }}
21
- bundler-cache: true # runs `bundle install` and caches installed gems automatically
22
- - run: bundle exec rake
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- .byebug_history
10
- *.gem
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.3.7
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in fixtury.gemspec
4
- gemspec
data/Gemfile.lock DELETED
@@ -1,132 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- fixtury (2.2.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- activemodel (8.0.2)
10
- activesupport (= 8.0.2)
11
- activerecord (8.0.2)
12
- activemodel (= 8.0.2)
13
- activesupport (= 8.0.2)
14
- timeout (>= 0.4.0)
15
- activesupport (8.0.2)
16
- base64
17
- benchmark (>= 0.3)
18
- bigdecimal
19
- concurrent-ruby (~> 1.0, >= 1.3.1)
20
- connection_pool (>= 2.2.5)
21
- drb
22
- i18n (>= 1.6, < 2)
23
- logger (>= 1.4.2)
24
- minitest (>= 5.1)
25
- securerandom (>= 0.3)
26
- tzinfo (~> 2.0, >= 2.0.5)
27
- uri (>= 0.13.1)
28
- base64 (0.2.0)
29
- benchmark (0.4.0)
30
- bigdecimal (3.1.9)
31
- byebug (12.0.0)
32
- concurrent-ruby (1.3.5)
33
- connection_pool (2.5.0)
34
- drb (2.2.1)
35
- globalid (1.2.1)
36
- activesupport (>= 6.1)
37
- i18n (1.14.7)
38
- concurrent-ruby (~> 1.0)
39
- logger (1.7.0)
40
- m (1.6.2)
41
- method_source (>= 0.6.7)
42
- rake (>= 0.9.2.2)
43
- method_source (1.1.0)
44
- mini_portile2 (2.8.8)
45
- minitest (5.25.5)
46
- mocha (2.7.1)
47
- ruby2_keywords (>= 0.0.5)
48
- rake (13.2.1)
49
- ruby2_keywords (0.0.5)
50
- securerandom (0.4.1)
51
- sqlite3 (2.6.0)
52
- mini_portile2 (~> 2.8.0)
53
- sqlite3 (2.6.0-aarch64-linux-gnu)
54
- sqlite3 (2.6.0-aarch64-linux-musl)
55
- sqlite3 (2.6.0-arm-linux-gnu)
56
- sqlite3 (2.6.0-arm-linux-musl)
57
- sqlite3 (2.6.0-arm64-darwin)
58
- sqlite3 (2.6.0-x86-linux-gnu)
59
- sqlite3 (2.6.0-x86-linux-musl)
60
- sqlite3 (2.6.0-x86_64-darwin)
61
- sqlite3 (2.6.0-x86_64-linux-gnu)
62
- sqlite3 (2.6.0-x86_64-linux-musl)
63
- timeout (0.4.3)
64
- tzinfo (2.0.6)
65
- concurrent-ruby (~> 1.0)
66
- uri (1.0.3)
67
-
68
- PLATFORMS
69
- aarch64-linux-gnu
70
- aarch64-linux-musl
71
- arm-linux-gnu
72
- arm-linux-musl
73
- arm64-darwin
74
- ruby
75
- x86-linux-gnu
76
- x86-linux-musl
77
- x86_64-darwin
78
- x86_64-linux-gnu
79
- x86_64-linux-musl
80
-
81
- DEPENDENCIES
82
- activerecord
83
- bundler
84
- byebug
85
- fixtury!
86
- globalid
87
- m
88
- minitest
89
- mocha
90
- rake
91
- sqlite3
92
-
93
- CHECKSUMS
94
- activemodel (8.0.2) sha256=0ae1fb7fa1fae0699ba041a9e97702df42ea3b13f2d39f2d0fde51fca5f0656c
95
- activerecord (8.0.2) sha256=793470b92c44e4198d0262ac60086b7822f0ea585079ad67e32a6e4c86f2d90a
96
- activesupport (8.0.2) sha256=8565cddba31b900cdc17682fd66ecd020441e3eef320a9930285394e8c07a45e
97
- base64 (0.2.0) sha256=0f25e9b21a02a0cc0cea8ef92b2041035d39350946e8789c562b2d1a3da01507
98
- benchmark (0.4.0) sha256=0f12f8c495545e3710c3e4f0480f63f06b4c842cc94cec7f33a956f5180e874a
99
- bigdecimal (3.1.9) sha256=2ffc742031521ad69c2dfc815a98e426a230a3d22aeac1995826a75dabfad8cc
100
- byebug (12.0.0) sha256=d4a150d291cca40b66ec9ca31f754e93fed8aa266a17335f71bb0afa7fca1a1e
101
- concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
102
- connection_pool (2.5.0) sha256=233b92f8d38e038c1349ccea65dd3772727d669d6d2e71f9897c8bf5cd53ebfc
103
- drb (2.2.1) sha256=e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340
104
- fixtury (2.2.0)
105
- globalid (1.2.1) sha256=70bf76711871f843dbba72beb8613229a49429d1866828476f9c9d6ccc327ce9
106
- i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
107
- logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
108
- m (1.6.2) sha256=2fb85aff050b6b699e6dbca47b45d426e2136ccdfabb64437e9630230d29108e
109
- method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
110
- mini_portile2 (2.8.8) sha256=8e47136cdac04ce81750bb6c09733b37895bf06962554e4b4056d78168d70a75
111
- minitest (5.25.5) sha256=391b6c6cb43a4802bfb7c93af1ebe2ac66a210293f4a3fb7db36f2fc7dc2c756
112
- mocha (2.7.1) sha256=8f7d538d5d3ebc75fc788b3d92fbab913a93a78462d2a3ce99d1bdde7af7f851
113
- rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
114
- ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef
115
- securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
116
- sqlite3 (2.6.0) sha256=a1c625f11948e6726eb082700283a8a3f4cf20b0548c0051c6104c56fedbe314
117
- sqlite3 (2.6.0-aarch64-linux-gnu) sha256=febc29bd7037695779d6b482fac7f7add9af7b420a1c5120ccff79213415975e
118
- sqlite3 (2.6.0-aarch64-linux-musl) sha256=d235cf89ba96067462562bc71adf5309363a9fee09a1864667f45799f26825ca
119
- sqlite3 (2.6.0-arm-linux-gnu) sha256=5f7e1160ad6bf6bfc0d42d1a7de95554b00a5dc7375953070d9633fedadc93bd
120
- sqlite3 (2.6.0-arm-linux-musl) sha256=a1a884d4eab3e7899badaa01f6894bb18b6ffda07fbdc4bc27c676b704f33630
121
- sqlite3 (2.6.0-arm64-darwin) sha256=88a793bf0010339e85657e460ab3ad2c7e9ee5d0e468b9dea383ff1039380056
122
- sqlite3 (2.6.0-x86-linux-gnu) sha256=0418d9b5e9e4cd3dcee1990c4f40055d4337136e4e66d9deb7b8d95f0192be09
123
- sqlite3 (2.6.0-x86-linux-musl) sha256=8afa15a5191f3cd42b720477867770749f136778818b518d91a0a467d1074071
124
- sqlite3 (2.6.0-x86_64-darwin) sha256=97bbd4ae83ca7ad49b2c79a07f07071a9ed97070dd33e44f7224acf4bd30f622
125
- sqlite3 (2.6.0-x86_64-linux-gnu) sha256=415a950be612b865152dd4529b16fdce2c8962ff9fa3f6b95adbfa7b8f54f2d0
126
- sqlite3 (2.6.0-x86_64-linux-musl) sha256=6f7c9346430c4aacc9280dee6bd4d23a6f1f31013d4f9c0a720fb14ef6a801c2
127
- timeout (0.4.3) sha256=9509f079b2b55fe4236d79633bd75e34c1c1e7e3fb4b56cb5fda61f80a0fe30e
128
- tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
129
- uri (1.0.3) sha256=e9f2244608eea2f7bc357d954c65c910ce0399ca5e18a7a29207ac22d8767011
130
-
131
- BUNDLED WITH
132
- 2.6.7
data/README.md DELETED
@@ -1,113 +0,0 @@
1
- # Fixtury
2
-
3
- Fixtury aims to provide an interface for creating, managing, and accessing test data in a simple and on-demand way. It has no opinion on how you generate the data, it simply provides efficient ways to access it.
4
-
5
- Often, fixture frameworks require you to either heavily maintain static fixtures or generate all your fixtures at runtime. Fixtury attempts to find a middle ground that enables a faster and more effecient development process while allowing you to generate realistic test data.
6
-
7
- For example, if a developer is running a test locally in their development environment there's no reason to build all fixtures for your suite of 30k tests. Instead, if we're able to track the fixture dependencies of the tests that are running we can build (and cache) the data relevant for the specific tests that are run.
8
-
9
- ```ruby
10
- require "fixtury/minitest_hooks"
11
-
12
- class MyTest < ::Minitest::Test
13
- prepend ::Fixtury::MintestHooks
14
-
15
- fixtury "users/fresh", as: :user
16
-
17
- def test_whatever
18
- assert_eq "Doug", user.first_name
19
- end
20
-
21
- end
22
- ```
23
-
24
- Loading this file would ensure `users/fresh` is loaded into the fixture set before the suite is run. In the context of Minitest::Test, the Fixtury::MinitestHooks file will ensure the fixtures are present prior to your suite running.
25
-
26
- ## Configuration
27
-
28
- If you're using Rails, you can `require "fixtury/railtie"` to accomplish a standard installation which will observe common rails files for changes and expects fixture definitions to defined in `test/fixtures`. See the railtie class for details.
29
-
30
- For non-rails environments or additional configuration, you can open up the Fixtury configuration like so:
31
- ```ruby
32
- ::Fixtury.configure do |config|
33
- config.locator_backend = :global_id # the locator behavior to use for finding fixtures
34
- config.filepath = File.join(root, "tmp/fixtury.yml") # the location to dump the fixtury references
35
- config.add_fixture_path = File.join(root, "fixtures/**/*.rb")
36
- config.add_dependency_path = File.join(root, "db/schema.rb")
37
- end
38
- ```
39
- See Fixtury::Configuration for all options.
40
-
41
- When your Fixtury is configured, you should call `Fixtury.start`.
42
-
43
- For minitest integration, you should dump the configuration file after the suite runs or after your fixture dependencies are built:
44
-
45
- ```ruby
46
- ::Minitest.after_run do
47
- ::Fixtury.configuration.dump_file
48
- end
49
- ```
50
-
51
- In a CI environment, we'd likely want to preload all fixtures to produce a database snapshot to be shared. This can be done by configuring Fixtury, calling `Fixtury.start`, then calling `Fixtury.load_all_fixtures`. All fixtures declared in the configuration's fixture_paths will be loaded.
52
-
53
- ## Defining Fixtures
54
-
55
- There are two primary principals in Fixtury: namespaces and fixture definitions. See below for an example of how they're used.
56
-
57
- ```ruby
58
- Fixtury.define do
59
-
60
- fixture "user" do
61
- User.create(...)
62
- end
63
-
64
- namespace "addresses" do
65
- fixture "sample" do
66
- Address.create(...)
67
- end
68
- end
69
-
70
- namespace "user_with_address" do
71
- fixture "user", deps: "address" do |deps|
72
- User.create(address_id: deps.address.id, ...)
73
- end
74
-
75
- fixture "address" do
76
- Address.create(...)
77
- end
78
- end
79
- end
80
- ```
81
-
82
- As you can see fixtures are named in a nested structure and can refer to each other via dependencies. See Fixtury::Dependency for more specifics.
83
-
84
- ## Isolation Levels
85
-
86
- Isolation keys enable groups of fixtures to use and modify the same resources. When one fixture from an isolation level is built, all fixtures in that isolation level are built. This allows multiple fixtures to potentially mutate a resource while keeping the definition consistent.
87
-
88
- ```ruby
89
- Fixtury.define do
90
- namespace "use_cases" do
91
- namespace "onboarded", isolate: true do
92
-
93
- fixture "user" do
94
- User.create(...)
95
- end
96
-
97
- fixture "profile", deps: "user" do |deps|
98
- profile = Profile.create(user: deps.user, ...)
99
- user.update(profiles_count: 1, onboarded_at: Time.current)
100
- profile
101
- end
102
-
103
- end
104
- end
105
- end
106
- ```
107
-
108
- ### ActiveRecord Integration
109
-
110
- When installed with the railtie, a MutationObserver module is prepended into ActiveRecord::Base. It observes record mutations and ensures a record is not mutated outside of the declared isolation level. If you're not using ActiveRecord check out Fixtury::MutationObserver to see how you could hook into other frameworks.
111
-
112
- In your test suite when utilizing the Fixtury::MinitestHooks records will be loaded before ActiveRecord's transactional fixtures transaction is opened. This means the you can define all your fixtures in your tests, they will be prebuilt and, as long as the fixtury references are preserved, all your fixtures are cached across runs. The fixtures in each file are loaded on demand which means only the fixtures necessary for the test to run are prebuilt (and cached for reuse). Standard transactional fixture rollback occurs after each test run so any mutation to fixtures will not be persisted.
113
-
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- end
9
-
10
- task :default => :test