eac_rails_gem_support 0.9.1 → 0.10.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: f8ac36d1bed932c42a4264d8d71135cbe71b34cce11fadd605b0f68e031828f5
4
- data.tar.gz: 9d28657cd7c9ec21e89d4251e464530c8ad26e15b7d0f9ac0e936d06a9738b9a
3
+ metadata.gz: 33fdb6c18e82d93b8c5e07116f10c426a30639156796b2564ddeac9bd63aeaa7
4
+ data.tar.gz: e38caafa4918b002b808e27940fd8111730a9520fb58a689882578f318c484c3
5
5
  SHA512:
6
- metadata.gz: 503cae086419abaff8c0cbac62a975bbca98424086cb5d700a766255b5a98c27e3514c3fa57d20899284db1908555a1a5f9985597fc5e355b68db08d01758ed2
7
- data.tar.gz: 4f4bed3fa63257f93ebba447c136312e3a5f1dbc48442897aa38b4ccc307163fd5f88af396f9b2f4b92f2b412b783d36908e80775bbda534a7407680f60e1064
6
+ metadata.gz: 9fcd1a213693210bdef7ca6d38dc80f7a8003373f2f347c364c0b8923e23f045269dbc6e185eeb1c1c14e2a3453f39be53d087c0c49c59f62ea8cc47c6047dd5
7
+ data.tar.gz: ec8f89cc2f60564cc9acb25f5f45e521e2a34da29af4be7b6f87d4b31d8553558be080bae61ff1ad885f281e8bcaf5987bc652e2ffa59fb9ae97eb9fe3f1e71b
@@ -15,7 +15,7 @@ module EacRailsGemSupport
15
15
  obj.setup_rails_env
16
16
  return unless obj.setup_rails_app
17
17
 
18
- %w[fixtures capybara factory_bot].each do |item|
18
+ %w[fixtures capybara factory_bot shared_examples].each do |item|
19
19
  obj.send("setup_#{item}")
20
20
  end
21
21
  end
@@ -23,6 +23,10 @@ module EacRailsGemSupport
23
23
  def setup_minitest_support
24
24
  rspec_config.include ::EacRailsGemSupport::Rspec::MinitestSupport
25
25
  end
26
+
27
+ def setup_shared_examples
28
+ require 'eac_rails_gem_support/rspec/shared_examples/active_model_attribute_validator'
29
+ end
26
30
  end
27
31
  end
28
32
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.shared_examples 'active_model_attribute_validator' do |valid_values, invalid_values| # rubocop:disable Metrics/BlockLength
4
+ let(:model) do
5
+ validator = described_class.name.gsub(/Validator\z/, '').underscore
6
+ Class.new do
7
+ include ActiveModel::Model
8
+
9
+ attr_accessor :the_attribute
10
+
11
+ validates :the_attribute, validator => true, allow_nil: true
12
+ end
13
+ end
14
+ let(:record) { model.new }
15
+
16
+ { true => valid_values, false => invalid_values }.each do |valid, values|
17
+ values.each do |value|
18
+ context "when the_attribute is \"#{value}\"" do
19
+ before do
20
+ record.the_attribute = value
21
+ record.valid?
22
+ end
23
+
24
+ if valid
25
+ it { expect(record).to be_valid }
26
+ it { expect(record.errors[:the_attribute]).to eq([]) }
27
+ else
28
+ it { expect(record).not_to be_valid }
29
+ it { expect(record.errors[:the_attribute]).not_to eq([]) }
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsGemSupport
4
- VERSION = '0.9.1'
4
+ VERSION = '0.10.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_gem_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-04 00:00:00.000000000 Z
11
+ date: 2024-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-eac_ruby_base1
@@ -56,28 +56,28 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0.9'
59
+ version: '0.10'
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '0.9'
66
+ version: '0.10'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: eac_ruby_utils
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '0.120'
73
+ version: '0.121'
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '0.120'
80
+ version: '0.121'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: eac_templates
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -85,6 +85,9 @@ dependencies:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0.5'
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 0.5.1
88
91
  type: :runtime
89
92
  prerelease: false
90
93
  version_requirements: !ruby/object:Gem::Requirement
@@ -92,6 +95,9 @@ dependencies:
92
95
  - - "~>"
93
96
  - !ruby/object:Gem::Version
94
97
  version: '0.5'
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 0.5.1
95
101
  - !ruby/object:Gem::Dependency
96
102
  name: factory_bot_rails
97
103
  requirement: !ruby/object:Gem::Requirement
@@ -112,6 +118,40 @@ dependencies:
112
118
  - - ">="
113
119
  - !ruby/object:Gem::Version
114
120
  version: 6.4.3
121
+ - !ruby/object:Gem::Dependency
122
+ name: launchy
123
+ requirement: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '2.5'
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 2.5.2
131
+ type: :runtime
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '2.5'
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: 2.5.2
141
+ - !ruby/object:Gem::Dependency
142
+ name: letter_opener
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: '1.9'
148
+ type: :runtime
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: '1.9'
115
155
  - !ruby/object:Gem::Dependency
116
156
  name: rails
117
157
  requirement: !ruby/object:Gem::Requirement
@@ -158,14 +198,20 @@ dependencies:
158
198
  requirements:
159
199
  - - "~>"
160
200
  - !ruby/object:Gem::Version
161
- version: '1.7'
201
+ version: '1.6'
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: 1.6.9
162
205
  type: :runtime
163
206
  prerelease: false
164
207
  version_requirements: !ruby/object:Gem::Requirement
165
208
  requirements:
166
209
  - - "~>"
167
210
  - !ruby/object:Gem::Version
168
- version: '1.7'
211
+ version: '1.6'
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: 1.6.9
169
215
  description:
170
216
  email:
171
217
  executables: []
@@ -183,6 +229,7 @@ files:
183
229
  - lib/eac_rails_gem_support/rspec/setup/factory_bot.rb
184
230
  - lib/eac_rails_gem_support/rspec/setup/fixtures.rb
185
231
  - lib/eac_rails_gem_support/rspec/setup/rails_app.rb
232
+ - lib/eac_rails_gem_support/rspec/shared_examples/active_model_attribute_validator.rb
186
233
  - lib/eac_rails_gem_support/version.rb
187
234
  - template/eac_rails_gem_support/rspec/appendable_rails_app/Gemfile.template
188
235
  - template/eac_rails_gem_support/rspec/appendable_rails_app/Rakefile