copy_tuner_client 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,17 +3,16 @@ require 'spec_helper'
3
3
  describe CopyTunerClient do
4
4
 
5
5
  before do
6
- CopyTunerClient.configuration.stubs(:cache => 'cache',
7
- :client => 'client')
6
+ allow(CopyTunerClient.configuration).to receive_messages(cache: 'cache', client: 'client')
8
7
  end
9
8
 
10
9
  it 'delegates cache to the configuration object' do
10
+ expect(CopyTunerClient.configuration).to receive(:cache).once
11
11
  expect(CopyTunerClient.cache).to eq('cache')
12
- expect(CopyTunerClient.configuration).to have_received(:cache).once
13
12
  end
14
13
 
15
14
  it 'delegates client to the configuration object' do
15
+ expect(CopyTunerClient.configuration).to receive(:client).once
16
16
  expect(CopyTunerClient.client).to eq('client')
17
- expect(CopyTunerClient.configuration).to have_received(:client).once
18
17
  end
19
18
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'rspec'
3
- require 'bourne'
4
3
  require 'sham_rack'
5
4
  require 'webmock/rspec'
6
5
  require 'active_support'
@@ -22,7 +21,6 @@ ShamRack.at('copy-tuner.com', 443).mount(FakeCopyTunerApp.new)
22
21
  RSpec.configure do |config|
23
22
  config.include ClientSpecHelpers
24
23
  config.include WebMock::API
25
- config.mock_with :mocha
26
24
 
27
25
  config.before do
28
26
  FakeCopyTunerApp.reset
@@ -4,6 +4,9 @@ class FakeClient
4
4
  @uploaded = {}
5
5
  @uploads = 0
6
6
  @downloads = 0
7
+ @mutex = Mutex.new
8
+ @cond = ConditionVariable.new
9
+ @go = false
7
10
  end
8
11
 
9
12
  attr_reader :uploaded, :uploads, :downloads
@@ -36,11 +39,20 @@ class FakeClient
36
39
  @downloads > 0
37
40
  end
38
41
 
42
+ def go
43
+ @mutex.synchronize do
44
+ @go = true
45
+ @cond.signal
46
+ end
47
+ end
48
+
39
49
  private
40
50
 
41
51
  def wait_for_delay
42
52
  if delay
43
- sleep delay
53
+ @mutex.synchronize do
54
+ @cond.wait(@mutex) until @go
55
+ end
44
56
  end
45
57
  end
46
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy_tuner_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - SonicGarden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.6.0
69
- - !ruby/object:Gem::Dependency
70
- name: bourne
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: cucumber
85
71
  requirement: !ruby/object:Gem::Requirement