subroutine-factory 0.2.0 → 0.4.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 +4 -4
- data/lib/subroutine/factory/version.rb +1 -1
- data/subroutine-factory.gemspec +8 -5
- metadata +12 -19
- data/.gitignore +0 -10
- data/.ruby-version +0 -1
- data/.travis.yml +0 -4
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -21
- data/README.md +0 -84
- data/Rakefile +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37f6569cbcd3c95b82e1264599fb1d80ea80205aab23a7e90f4184a47f935730
|
|
4
|
+
data.tar.gz: 69d9a815a47eb5b48605eed0a4534926f0a9e8cd81e43a0667a105c6d993c922
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e82ba0dacc08e478dfc8958b949b9ef7db5cb964ab7d0a466cd98eb1d1858c34b91803eb7e45f6af68b98ef85d835fa02e58405eb3fbbc355e1231071588e4d
|
|
7
|
+
data.tar.gz: 74a5d4b2ca29c07ff35029dfb6af687283bb5795290dcc5c510e67e24d5a5960d566cba8b2eb21c138b4e574e65179b4d4b14b1424ac2aa7cedee1e3ec5a9fc2
|
data/subroutine-factory.gemspec
CHANGED
|
@@ -11,24 +11,27 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
|
|
12
12
|
spec.summary = %q{Test factories for ops using Subroutine Ops}
|
|
13
13
|
spec.description = %q{Test factories for ops using Subroutine Ops}
|
|
14
|
-
spec.homepage = "https://github.com/
|
|
14
|
+
spec.homepage = "https://github.com/guideline-tech/subroutine-factory"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
|
18
18
|
# delete this section to allow pushing this gem to any host.
|
|
19
19
|
if spec.respond_to?(:metadata)
|
|
20
20
|
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
|
21
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
21
22
|
else
|
|
22
23
|
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
|
23
24
|
end
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
spec.
|
|
27
|
-
spec.
|
|
26
|
+
# Specify which files should be added to the gem when it is released.
|
|
27
|
+
spec.files = Dir["lib/**/*"] + Dir["*.gemspec"] + Dir["bin/**/*"]
|
|
28
|
+
spec.bindir = "bin"
|
|
29
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
30
|
+
spec.required_ruby_version = ">= 3.3.0"
|
|
28
31
|
spec.require_paths = ["lib"]
|
|
29
32
|
|
|
30
33
|
spec.add_dependency "subroutine"
|
|
31
|
-
spec.add_dependency "activesupport", ">=
|
|
34
|
+
spec.add_dependency "activesupport", ">= 6.1"
|
|
32
35
|
|
|
33
36
|
spec.add_development_dependency "bundler"
|
|
34
37
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: subroutine-factory
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Nelson
|
|
8
|
-
|
|
9
|
-
bindir: exe
|
|
8
|
+
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: subroutine
|
|
@@ -30,14 +29,14 @@ dependencies:
|
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
32
|
+
version: '6.1'
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
39
|
+
version: '6.1'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: bundler
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -97,17 +96,12 @@ dependencies:
|
|
|
97
96
|
description: Test factories for ops using Subroutine Ops
|
|
98
97
|
email:
|
|
99
98
|
- mike@mnelson.io
|
|
100
|
-
executables:
|
|
99
|
+
executables:
|
|
100
|
+
- console
|
|
101
|
+
- setup
|
|
101
102
|
extensions: []
|
|
102
103
|
extra_rdoc_files: []
|
|
103
104
|
files:
|
|
104
|
-
- ".gitignore"
|
|
105
|
-
- ".ruby-version"
|
|
106
|
-
- ".travis.yml"
|
|
107
|
-
- Gemfile
|
|
108
|
-
- LICENSE.txt
|
|
109
|
-
- README.md
|
|
110
|
-
- Rakefile
|
|
111
105
|
- bin/console
|
|
112
106
|
- bin/setup
|
|
113
107
|
- lib/subroutine/factory.rb
|
|
@@ -116,12 +110,12 @@ files:
|
|
|
116
110
|
- lib/subroutine/factory/spec_helper.rb
|
|
117
111
|
- lib/subroutine/factory/version.rb
|
|
118
112
|
- subroutine-factory.gemspec
|
|
119
|
-
homepage: https://github.com/
|
|
113
|
+
homepage: https://github.com/guideline-tech/subroutine-factory
|
|
120
114
|
licenses:
|
|
121
115
|
- MIT
|
|
122
116
|
metadata:
|
|
123
117
|
allowed_push_host: https://rubygems.org
|
|
124
|
-
|
|
118
|
+
rubygems_mfa_required: 'true'
|
|
125
119
|
rdoc_options: []
|
|
126
120
|
require_paths:
|
|
127
121
|
- lib
|
|
@@ -129,15 +123,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
129
123
|
requirements:
|
|
130
124
|
- - ">="
|
|
131
125
|
- !ruby/object:Gem::Version
|
|
132
|
-
version:
|
|
126
|
+
version: 3.3.0
|
|
133
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
128
|
requirements:
|
|
135
129
|
- - ">="
|
|
136
130
|
- !ruby/object:Gem::Version
|
|
137
131
|
version: '0'
|
|
138
132
|
requirements: []
|
|
139
|
-
rubygems_version:
|
|
140
|
-
signing_key:
|
|
133
|
+
rubygems_version: 4.0.9
|
|
141
134
|
specification_version: 4
|
|
142
135
|
summary: Test factories for ops using Subroutine Ops
|
|
143
136
|
test_files: []
|
data/.gitignore
DELETED
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.0.6
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 Mike Nelson
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# Subroutine::Factory
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
Add this line to your application's Gemfile:
|
|
6
|
-
|
|
7
|
-
```ruby
|
|
8
|
-
gem 'subroutine-factory'
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
And then execute:
|
|
12
|
-
|
|
13
|
-
$ bundle
|
|
14
|
-
|
|
15
|
-
Or install it yourself as:
|
|
16
|
-
|
|
17
|
-
$ gem install subroutine-factory
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
The Subroutine gem does a great job of encapsulating your app's business logic. To simplify the usage of Subroutine Ops in your test suite, utilize the subroutine-factory gem.
|
|
22
|
-
|
|
23
|
-
Defining factories:
|
|
24
|
-
|
|
25
|
-
```ruby
|
|
26
|
-
Subroutine::Factory.define :signup do
|
|
27
|
-
op ::SignupOp
|
|
28
|
-
|
|
29
|
-
inputs :email, sequence{|n| "foo{n}@example.com" }
|
|
30
|
-
inputs :password, "password123"
|
|
31
|
-
|
|
32
|
-
# by default, the op will be returned when the factory is used.
|
|
33
|
-
# this `output` returns the value of the accessor on the resulting op
|
|
34
|
-
output :user
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
Subroutine::Factory.define :business_signup do
|
|
38
|
-
|
|
39
|
-
# all configurations are inherited from the "signup" factory
|
|
40
|
-
parent :signup
|
|
41
|
-
|
|
42
|
-
op ::BusinessSignupOp
|
|
43
|
-
|
|
44
|
-
input :business_name, sequence{|n| "Business #{n}" }
|
|
45
|
-
|
|
46
|
-
# you can output multiple things into a hash by using `outputs`
|
|
47
|
-
outputs :user, :business
|
|
48
|
-
end
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Using Factories:
|
|
52
|
-
|
|
53
|
-
```ruby
|
|
54
|
-
user = Subroutine::Factory.create :signup
|
|
55
|
-
user = Subroutine::Factory.create :signup, email: "foo@bar.com"
|
|
56
|
-
|
|
57
|
-
out = Subroutine::Factory.create :business_signup
|
|
58
|
-
out[:user] #=> User{}
|
|
59
|
-
out[:business] #=> Business{}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Spec / Test Helper:
|
|
63
|
-
```ruby
|
|
64
|
-
#spec_helper.rb, test_helper.rb
|
|
65
|
-
config.include ::Subroutine::Factory::SpecHelper
|
|
66
|
-
|
|
67
|
-
# in your tests
|
|
68
|
-
user = factory(:signup)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Development
|
|
72
|
-
|
|
73
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
74
|
-
|
|
75
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
76
|
-
|
|
77
|
-
## Contributing
|
|
78
|
-
|
|
79
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/mnelson/subroutine-factory.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
## License
|
|
83
|
-
|
|
84
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|