delayed_job_groups_plugin 0.1.3 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe Delayed::JobGroups::YamlLoader do
4
+ class Foo; end
5
+
6
+ describe "#load" do
7
+ context "with a correct yaml object representation" do
8
+ let(:yaml) { '--- !ruby/object:Foo {}' }
9
+
10
+ it "deserializes from YAML properly" do
11
+ expect(Delayed::JobGroups::YamlLoader.load(yaml)).to be_a(Foo)
12
+ end
13
+ end
14
+
15
+ context "with incorrect yaml object representations" do
16
+ let(:not_yaml1) { 'foo' }
17
+ let(:not_yaml2) { 1 }
18
+
19
+ it "deserializes from YAML properly" do
20
+ expect(Delayed::JobGroups::YamlLoader.load(not_yaml1)).to eq('foo')
21
+ expect(Delayed::JobGroups::YamlLoader.load(not_yaml2)).to eq(1)
22
+ end
23
+ end
24
+ end
25
+
26
+ describe "#dump" do
27
+ context "with an object" do
28
+ let(:object) { Foo.new }
29
+
30
+ it "serializes into YAML properly" do
31
+ expect(Delayed::JobGroups::YamlLoader.dump(object)).to eq("--- !ruby/object:Foo {}\n")
32
+ end
33
+ end
34
+
35
+ context "with a nil object" do
36
+ let(:object) { nil }
37
+
38
+ it "serializes into YAML properly" do
39
+ expect(Delayed::JobGroups::YamlLoader.dump(object)).to eq(nil)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,16 +1,17 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'simplecov'
4
4
  require 'coveralls'
5
5
 
6
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
- SimpleCov::Formatter::HTMLFormatter,
8
- Coveralls::SimpleCov::Formatter
9
- ]
6
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
7
+ [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
8
+ )
9
+
10
10
  SimpleCov.start do
11
- add_filter 'spec'
11
+ add_filter 'spec'
12
12
  end
13
13
 
14
+ require 'rspec/its'
14
15
  require 'database_cleaner'
15
16
  require 'delayed_job_groups_plugin'
16
17
  require 'yaml'
@@ -30,27 +31,26 @@ ActiveRecord::Base.logger = Delayed::Worker.logger
30
31
  ActiveRecord::Migration.verbose = false
31
32
 
32
33
  db_adapter = ENV.fetch('ADAPTER', 'sqlite3')
33
- config = YAML.load(File.read('spec/db/database.yml'))
34
- ActiveRecord::Base.establish_connection(config[db_adapter])
34
+ db_config = YAML.safe_load(File.read('spec/db/database.yml'))
35
+ ActiveRecord::Base.establish_connection(db_config[db_adapter])
35
36
  require 'db/schema'
36
37
 
37
38
  RSpec.configure do |config|
38
- config.treat_symbols_as_metadata_keys_with_true_values = true
39
39
  config.order = 'random'
40
40
 
41
41
  config.before(:suite) do
42
42
  DatabaseCleaner.clean_with(:truncation)
43
43
  end
44
44
 
45
- config.before(:each) do
45
+ config.before do
46
46
  DatabaseCleaner.strategy = :transaction
47
47
  end
48
48
 
49
- config.before(:each) do
49
+ config.before do
50
50
  DatabaseCleaner.start
51
51
  end
52
52
 
53
- config.after(:each) do
53
+ config.after do
54
54
  DatabaseCleaner.clean
55
55
  end
56
56
  end
@@ -1,4 +1,4 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec::Matchers.define :have_been_destroyed do
4
4
  match do |actual|
@@ -6,10 +6,10 @@ RSpec::Matchers.define :have_been_destroyed do
6
6
  end
7
7
 
8
8
  description do
9
- "model should have been destroyed"
9
+ 'model should have been destroyed'
10
10
  end
11
11
 
12
- failure_message_for_should do |actual|
12
+ failure_message do |actual|
13
13
  "expected #{actual.class}(id: #{actual.id}) to have been destroyed"
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_groups_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Turkel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-26 00:00:00.000000000 Z
12
+ date: 2020-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: delayed_job
@@ -17,48 +17,62 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '3.0'
20
+ version: '4.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '3.0'
27
+ version: '4.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: delayed_job_active_record
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '0.4'
34
+ version: '4.1'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '0.4'
41
+ version: '4.1'
42
+ - !ruby/object:Gem::Dependency
43
+ name: appraisal
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: activerecord
44
58
  requirement: !ruby/object:Gem::Requirement
45
59
  requirements:
46
60
  - - ">="
47
61
  - !ruby/object:Gem::Version
48
- version: '3.2'
62
+ version: '4.2'
49
63
  - - "<"
50
64
  - !ruby/object:Gem::Version
51
- version: '5.0'
52
- type: :development
65
+ version: '6.1'
66
+ type: :runtime
53
67
  prerelease: false
54
68
  version_requirements: !ruby/object:Gem::Requirement
55
69
  requirements:
56
70
  - - ">="
57
71
  - !ruby/object:Gem::Version
58
- version: '3.2'
72
+ version: '4.2'
59
73
  - - "<"
60
74
  - !ruby/object:Gem::Version
61
- version: '5.0'
75
+ version: '6.1'
62
76
  - !ruby/object:Gem::Dependency
63
77
  name: coveralls
64
78
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +101,20 @@ dependencies:
87
101
  - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: '1.2'
104
+ - !ruby/object:Gem::Dependency
105
+ name: mime-types
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
90
118
  - !ruby/object:Gem::Dependency
91
119
  name: rake
92
120
  requirement: !ruby/object:Gem::Requirement
@@ -105,38 +133,60 @@ dependencies:
105
133
  name: rspec
106
134
  requirement: !ruby/object:Gem::Requirement
107
135
  requirements:
108
- - - ">="
136
+ - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '2.14'
111
- - - "<"
138
+ version: '3'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
112
144
  - !ruby/object:Gem::Version
113
- version: '2.99'
145
+ version: '3'
146
+ - !ruby/object:Gem::Dependency
147
+ name: rspec-its
148
+ requirement: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
114
153
  type: :development
115
154
  prerelease: false
116
155
  version_requirements: !ruby/object:Gem::Requirement
117
156
  requirements:
118
157
  - - ">="
119
158
  - !ruby/object:Gem::Version
120
- version: '2.14'
121
- - - "<"
159
+ version: '0'
160
+ - !ruby/object:Gem::Dependency
161
+ name: salsify_rubocop
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '='
122
165
  - !ruby/object:Gem::Version
123
- version: '2.99'
166
+ version: 0.52.1.1
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '='
172
+ - !ruby/object:Gem::Version
173
+ version: 0.52.1.1
124
174
  - !ruby/object:Gem::Dependency
125
175
  name: simplecov
126
176
  requirement: !ruby/object:Gem::Requirement
127
177
  requirements:
128
- - - "~>"
178
+ - - ">="
129
179
  - !ruby/object:Gem::Version
130
- version: 0.7.1
180
+ version: '0'
131
181
  type: :development
132
182
  prerelease: false
133
183
  version_requirements: !ruby/object:Gem::Requirement
134
184
  requirements:
135
- - - "~>"
185
+ - - ">="
136
186
  - !ruby/object:Gem::Version
137
- version: 0.7.1
187
+ version: '0'
138
188
  - !ruby/object:Gem::Dependency
139
- name: timecop
189
+ name: sqlite3
140
190
  requirement: !ruby/object:Gem::Requirement
141
191
  requirements:
142
192
  - - ">="
@@ -150,7 +200,7 @@ dependencies:
150
200
  - !ruby/object:Gem::Version
151
201
  version: '0'
152
202
  - !ruby/object:Gem::Dependency
153
- name: sqlite3
203
+ name: timecop
154
204
  requirement: !ruby/object:Gem::Requirement
155
205
  requirements:
156
206
  - - ">="
@@ -174,18 +224,26 @@ extra_rdoc_files: []
174
224
  files:
175
225
  - ".gitignore"
176
226
  - ".rspec"
227
+ - ".rubocop.yml"
177
228
  - ".travis.yml"
229
+ - Appraisals
178
230
  - CHANGELOG.md
179
231
  - Gemfile
180
232
  - LICENSE.txt
181
233
  - README.md
182
234
  - Rakefile
183
235
  - delayed_job_groups.gemspec
236
+ - gemfiles/rails_4.2.gemfile
237
+ - gemfiles/rails_5.0.gemfile
238
+ - gemfiles/rails_5.1.gemfile
239
+ - gemfiles/rails_5.2.gemfile
240
+ - gemfiles/rails_6.0.gemfile
184
241
  - lib/delayed/job_groups/compatibility.rb
185
242
  - lib/delayed/job_groups/job_extensions.rb
186
243
  - lib/delayed/job_groups/job_group.rb
187
244
  - lib/delayed/job_groups/plugin.rb
188
245
  - lib/delayed/job_groups/version.rb
246
+ - lib/delayed/job_groups/yaml_loader.rb
189
247
  - lib/delayed_job_groups_plugin.rb
190
248
  - lib/generators/delayed_job_groups_plugin/install_generator.rb
191
249
  - lib/generators/delayed_job_groups_plugin/templates/migration.rb
@@ -193,6 +251,7 @@ files:
193
251
  - spec/db/schema.rb
194
252
  - spec/delayed/job_groups/job_group_spec.rb
195
253
  - spec/delayed/job_groups/plugin_spec.rb
254
+ - spec/delayed/job_groups/yaml_loader_spec.rb
196
255
  - spec/spec_helper.rb
197
256
  - spec/support/destroyed_model.rb
198
257
  homepage: https://github.com/salsify/delayed_job_groups_plugin
@@ -208,22 +267,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
267
  requirements:
209
268
  - - ">="
210
269
  - !ruby/object:Gem::Version
211
- version: '0'
270
+ version: '2.3'
212
271
  required_rubygems_version: !ruby/object:Gem::Requirement
213
272
  requirements:
214
273
  - - ">="
215
274
  - !ruby/object:Gem::Version
216
275
  version: '0'
217
276
  requirements: []
218
- rubyforge_project:
219
- rubygems_version: 2.4.5
277
+ rubygems_version: 3.0.8
220
278
  signing_key:
221
279
  specification_version: 4
222
280
  summary: Delayed::Job job groups plugin
223
281
  test_files:
224
- - spec/db/database.yml
225
- - spec/db/schema.rb
226
- - spec/delayed/job_groups/job_group_spec.rb
227
- - spec/delayed/job_groups/plugin_spec.rb
228
282
  - spec/spec_helper.rb
229
283
  - spec/support/destroyed_model.rb
284
+ - spec/delayed/job_groups/plugin_spec.rb
285
+ - spec/delayed/job_groups/job_group_spec.rb
286
+ - spec/delayed/job_groups/yaml_loader_spec.rb
287
+ - spec/db/schema.rb
288
+ - spec/db/database.yml