derail_specs 0.6.1 → 0.7.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: b8b54899a77d83026a909627639d48c24d9174e4069bd1a4e242666265c9a8c2
4
- data.tar.gz: 42cde73f7dc9e73dd79f6b2138bf137a308170e1f891a4f1e6dbc1d4e1b20383
3
+ metadata.gz: 1fd5a97903aa7dfafbbee9e93090b14179c89a1410fb7a0c61b407c65cfe97ca
4
+ data.tar.gz: 73c5204eb2d8e7dae4a2626cb7dc7fa864e6fed3206cd4e35c469e5bd669e62d
5
5
  SHA512:
6
- metadata.gz: 015e4dcb1c5fdf6c46ef12f4a2351054b59b427bcb065163667e89003a834c86c71e2bc13af12c9b3aab105c4f3e028d13c8e80579c45523b08d6121a722d308
7
- data.tar.gz: aec06f8aed5fdc6606c28d63b9b3729b42011b165ebda41c27a953a756723f18252553e8e9442c40e1fc4aca18bde22ef5d087a9ec5e9032faf0c3ff8dd5a6c0
6
+ metadata.gz: e25de02fa958daeba752d58148f4ac70fefe08561fcb2614274f3fefe7130cec6c6795586044bf398aa23b61e91683d25de8b671f28672d6a7d599812ff82bf6
7
+ data.tar.gz: 46e9ca67c97875ed08d71c18d6e965d587524a735ffef832d309f7b1283a15f37b4e3eae3aa9eff01e7b673ea3752e3df9e5205c957cad4f8753bee4900871e9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.7.0] - 2021-10-20
4
+
5
+ - Add support to mirror FactoryBot API including traits
6
+
3
7
  ## [0.6.1] - 2021-09-27
4
8
 
5
9
  - Change exit status of `rails derail_specs:run` to match config.command exit status when command is provided
data/bin/test CHANGED
@@ -6,6 +6,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6
6
 
7
7
  cd $DIR/..
8
8
  pwd
9
- rake
9
+ bundle exec rake
10
10
  cd example
11
11
  bundle exec rails derail_specs:run
data/example/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- derail_specs (0.6.1)
4
+ derail_specs (0.7.0)
5
5
  puma (>= 3.8.0)
6
6
  railties (>= 5.2.0)
7
7
 
@@ -162,4 +162,4 @@ RUBY VERSION
162
162
  ruby 3.0.2p107
163
163
 
164
164
  BUNDLED WITH
165
- 2.2.27
165
+ 2.2.29
data/example/factories.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  FactoryBot.define do
2
2
  factory :test do
3
3
  sequence(:name) { |n| "Test #{n}" }
4
+
5
+ trait(:trait1)
4
6
  end
5
7
  end
data/example/tests.sh CHANGED
@@ -11,3 +11,14 @@ curl -X POST \
11
11
  -d '["test", 3, { "name": "Test Name from Curl", "created_at": "2011-11-11 11:11:11" }]' \
12
12
  -H 'Content-Type: application/json' \
13
13
  127.0.0.1:3001/factory-bot/create-list
14
+
15
+ # With traits
16
+ curl -X POST \
17
+ -d '["test", "trait1", { "name": "Test Name from Curl", "created_at": "2011-11-11 11:11:11" }]' \
18
+ -H 'Content-Type: application/json' \
19
+ 127.0.0.1:3001/factory-bot/create
20
+
21
+ curl -X POST \
22
+ -d '["test", 3, "trait1", { "name": "Test Name from Curl", "created_at": "2011-11-11 11:11:11" }]' \
23
+ -H 'Content-Type: application/json' \
24
+ 127.0.0.1:3001/factory-bot/create-list
@@ -4,12 +4,13 @@ begin
4
4
 
5
5
  module DerailSpecs
6
6
  class FactoryBot
7
- def self.create(factory, options = nil)
8
- ::FactoryBot.create(factory, options)
7
+ def self.create(*args)
8
+ ::FactoryBot.create(*args)
9
9
  end
10
10
 
11
- def self.create_list(factory, count, options = nil)
12
- ::FactoryBot.create_list(factory, count, options)
11
+ def self.create_list(*args)
12
+ puts args.to_json
13
+ ::FactoryBot.create_list(*args)
13
14
  end
14
15
  end
15
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DerailSpecs
4
- VERSION = "0.6.1"
4
+ VERSION = "0.7.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derail_specs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Piechowski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma