fogged 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ module Fogged
15
15
  Rails.application.config.active_job.queue_adapter = :delayed_job
16
16
  Fogged.configure
17
17
 
18
- Resource.any_instance.expects(:url).twice.returns("http://lorempixel.com/800/600/cats")
18
+ Resource.any_instance.stubs(:url).returns("http://lorempixel.com/800/600/cats/")
19
19
 
20
20
  AWSThumbnailJob.perform_now(@resource)
21
21
 
@@ -40,9 +40,9 @@ module Fogged
40
40
  Rails.application.config.active_job.queue_adapter = :delayed_job
41
41
  Fogged.configure
42
42
 
43
- Resource.any_instance.expects(:url).returns("http://localhost:7777/image")
43
+ Resource.any_instance.stubs(:url).returns("http://localhost:7777/image")
44
44
 
45
- assert_raise(MiniMagick::Error) do
45
+ assert_raise(Errno::ECONNREFUSED) do
46
46
  AWSThumbnailJob.perform_now(@resource)
47
47
  end
48
48
  end
@@ -13,6 +13,7 @@ ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate',
13
13
 
14
14
  require "rails/test_help"
15
15
  require "mocha/mini_test"
16
+ require "spawnling"
16
17
 
17
18
  Minitest.backtrace_filter = Minitest::BacktraceFilter.new
18
19
 
@@ -33,31 +34,16 @@ class ActiveSupport::TestCase
33
34
  @response_json ||= JSON.parse(response.body, :symbolize_names => true)
34
35
  end
35
36
 
36
- # helper for fork testing
37
37
  def in_a_fork
38
38
  ActiveRecord::Base.connection.disconnect!
39
- begin
40
- rout, wout = IO.pipe
41
- pid = fork do
42
- STDERR.reopen(wout)
43
- begin
44
- ActiveRecord::Base.establish_connection
45
- yield
46
- ensure
47
- ActiveRecord::Base.connection.disconnect!
48
- end
49
-
50
- SimpleCov.at_exit {}
51
- end
52
- Process.waitpid(pid)
53
- wout.close
54
- result = rout.readlines
55
- unless result.empty?
56
- result.each { |r| STDERR.puts r }
57
- fail("Test in a fork has failed")
58
- end
59
- ensure
39
+ spawnling = Spawnling.new do
60
40
  ActiveRecord::Base.establish_connection
41
+ SimpleCov.at_exit {}
42
+ yield
43
+ ActiveRecord::Base.connection.disconnect!
61
44
  end
45
+ Spawnling.wait(spawnling)
46
+ ensure
47
+ ActiveRecord::Base.establish_connection
62
48
  end
63
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fogged
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Fernandez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -178,6 +178,48 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 4.2.1
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.39.0
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.39.0
195
+ - !ruby/object:Gem::Dependency
196
+ name: spawnling
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '2.1'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '2.1'
209
+ - !ruby/object:Gem::Dependency
210
+ name: gatemedia_rubocop
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: 0.2.0
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: 0.2.0
181
223
  description: Fogged provides helpers to use Fog resources more easily within Rails
182
224
  email:
183
225
  - david.fernandez@gatemedia.ch