dpl 1.6.1.travis.447.1 → 1.6.1.travis.449.1

Sign up to get free protection for your applications and to get access to all the features.
data/spec/provider/npm.rb CHANGED
@@ -6,27 +6,27 @@ describe DPL::Provider::NPM do
6
6
  described_class.new(DummyContext.new, :email => 'foo@blah.com', :api_key => 'test')
7
7
  end
8
8
 
9
- describe :check_auth do
9
+ describe "#check_auth" do
10
10
  example do
11
- provider.should_receive(:setup_auth)
12
- provider.should_receive(:log).with("Authenticated with email foo@blah.com")
11
+ expect(provider).to receive(:setup_auth)
12
+ expect(provider).to receive(:log).with("Authenticated with email foo@blah.com")
13
13
  provider.check_auth
14
14
  end
15
15
  end
16
16
 
17
- describe :push_app do
17
+ describe "#push_app" do
18
18
  example do
19
- provider.context.should_receive(:shell).with("npm publish")
19
+ expect(provider.context).to receive(:shell).with("npm publish")
20
20
  provider.push_app
21
21
  end
22
22
  end
23
23
 
24
- describe :setup_auth do
24
+ describe "#setup_auth" do
25
25
  example do
26
26
  f = double(:npmrc)
27
- File.should_receive(:open).with(File.expand_path(DPL::Provider::NPM::NPMRC_FILE)).and_return(f)
28
- f.should_receive(:puts).with("_auth = test")
29
- f.should_receive(:puts).with("email = foo@blah.com")
27
+ expect(File).to receive(:open).with(File.expand_path(DPL::Provider::NPM::NPMRC_FILE)).and_return(f)
28
+ expect(f).to receive(:puts).with("_auth = test")
29
+ expect(f).to receive(:puts).with("email = foo@blah.com")
30
30
  provider.setup_auth
31
31
  end
32
32
  end
@@ -7,12 +7,12 @@ describe DPL::Provider::Openshift do
7
7
  described_class.new(DummyContext.new, :user => 'foo', :password => 'foo', :domain => 'foo', :app => 'example', :key_name => 'key')
8
8
  end
9
9
 
10
- describe :api do
10
+ describe "#api" do
11
11
  it 'accepts a user and a password' do
12
12
  api = double(:api)
13
13
  provider.options.update(:user => "foo", :password => "bar")
14
- ::RHC::Rest::Client.should_receive(:new).with(:user => "foo", :password => "bar", :server => "openshift.redhat.com").and_return(api)
15
- provider.api.should be == api
14
+ expect(::RHC::Rest::Client).to receive(:new).with(:user => "foo", :password => "bar", :server => "openshift.redhat.com").and_return(api)
15
+ expect(provider.api).to eq(api)
16
16
  end
17
17
  end
18
18
 
@@ -29,60 +29,60 @@ describe DPL::Provider::Openshift do
29
29
  end
30
30
 
31
31
  before do
32
- ::RHC::Rest::Client.should_receive(:new).at_most(:once).and_return(api)
32
+ expect(::RHC::Rest::Client).to receive(:new).at_most(:once).and_return(api)
33
33
  provider.api
34
34
  end
35
35
 
36
36
  its(:api) {should be == api}
37
37
 
38
- describe :check_auth do
38
+ describe "#check_auth" do
39
39
  example do
40
- provider.should_receive(:log).with("authenticated as foo@bar.com")
40
+ expect(provider).to receive(:log).with("authenticated as foo@bar.com")
41
41
  provider.check_auth
42
42
  end
43
43
  end
44
44
 
45
- describe :check_app do
45
+ describe "#check_app" do
46
46
  example do
47
- provider.should_receive(:log).with("found app example")
47
+ expect(provider).to receive(:log).with("found app example")
48
48
  provider.check_app
49
49
  end
50
50
  end
51
51
 
52
- describe :setup_key do
52
+ describe "#setup_key" do
53
53
  example do
54
- File.should_receive(:read).with("the file").and_return("ssh-rsa\nfoo")
55
- api.should_receive(:add_key).with("key", "foo", "ssh-rsa")
54
+ expect(File).to receive(:read).with("the file").and_return("ssh-rsa\nfoo")
55
+ expect(api).to receive(:add_key).with("key", "foo", "ssh-rsa")
56
56
  provider.setup_key("the file")
57
57
  end
58
58
  end
59
59
 
60
- describe :remove_key do
60
+ describe "#remove_key" do
61
61
  example do
62
- api.should_receive(:delete_key).with("key")
62
+ expect(api).to receive(:delete_key).with("key")
63
63
  provider.remove_key
64
64
  end
65
65
  end
66
66
 
67
- describe :push_app do
67
+ describe "#push_app" do
68
68
  example "when app.deployment_branch is not set" do
69
- provider.app.should_receive :deployment_branch
70
- provider.context.should_receive(:shell).with("git push git://something -f")
69
+ expect(provider.app).to receive :deployment_branch
70
+ expect(provider.context).to receive(:shell).with("git push git://something -f")
71
71
  provider.push_app
72
72
  end
73
73
 
74
74
  example "when app.deployment_branch is set" do
75
- provider.app.stub(:deployment_branch) { "test-branch" }
75
+ allow(provider.app).to receive(:deployment_branch) { "test-branch" }
76
76
 
77
- provider.context.should_receive(:shell).with("rhc app configure example --deployment-branch test-branch")
78
- provider.context.should_receive(:shell).with("git push git://something -f test-branch")
77
+ expect(provider.context).to receive(:shell).with("rhc app configure example --deployment-branch test-branch")
78
+ expect(provider.context).to receive(:shell).with("git push git://something -f test-branch")
79
79
  provider.push_app
80
80
  end
81
81
  end
82
82
 
83
- describe :restart do
83
+ describe "#restart" do
84
84
  example do
85
- provider.app.should_receive(:restart)
85
+ expect(provider.app).to receive(:restart)
86
86
  provider.restart
87
87
  end
88
88
  end
@@ -13,42 +13,42 @@ describe DPL::Provider::OpsWorks do
13
13
  described_class.new(DummyContext.new, :access_key_id => 'qwertyuiopasdfghjklz', :secret_access_key => 'qwertyuiopasdfghjklzqwertyuiopasdfghjklz', :bucket => 'my-bucket')
14
14
  end
15
15
 
16
- describe :check_auth do
16
+ describe "#check_auth" do
17
17
  example do
18
- provider.should_receive(:setup_auth)
19
- provider.should_receive(:log).with('Logging in with Access Key: ****************jklz')
18
+ expect(provider).to receive(:setup_auth)
19
+ expect(provider).to receive(:log).with('Logging in with Access Key: ****************jklz')
20
20
  provider.check_auth
21
21
  end
22
22
  end
23
23
 
24
- describe :setup_auth do
24
+ describe "#setup_auth" do
25
25
  example do
26
- AWS.should_receive(:config).with(:access_key_id => 'qwertyuiopasdfghjklz', :secret_access_key => 'qwertyuiopasdfghjklzqwertyuiopasdfghjklz').once.and_call_original
26
+ expect(AWS).to receive(:config).with(:access_key_id => 'qwertyuiopasdfghjklz', :secret_access_key => 'qwertyuiopasdfghjklzqwertyuiopasdfghjklz').once.and_call_original
27
27
  provider.setup_auth
28
28
  end
29
29
  end
30
30
 
31
- describe :needs_key? do
31
+ describe "#needs_key?" do
32
32
  example do
33
- provider.needs_key?.should == false
33
+ expect(provider.needs_key?).to eq(false)
34
34
  end
35
35
  end
36
36
 
37
- describe :push_app do
37
+ describe "#push_app" do
38
38
  let(:client) { double(:ops_works_client) }
39
39
  let(:ops_works_app) { {shortname: 'app', stack_id: 'stack-id'} }
40
40
  before do
41
- provider.should_receive(:current_sha).and_return('sha')
42
- provider.api.should_receive(:client).and_return(client)
43
- ENV.should_receive(:[]).with('TRAVIS_BUILD_NUMBER').and_return('123')
41
+ expect(provider).to receive(:current_sha).and_return('sha')
42
+ expect(provider.api).to receive(:client).and_return(client)
43
+ expect(ENV).to receive(:[]).with('TRAVIS_BUILD_NUMBER').and_return('123')
44
44
  end
45
45
 
46
46
  let(:custom_json) { "{\"deploy\":{\"app\":{\"migrate\":false,\"scm\":{\"revision\":\"sha\"}}}}" }
47
47
  example 'without :migrate option' do
48
48
  provider.options.update(app_id: 'app-id')
49
- client.should_receive(:describe_apps).with(app_ids: ['app-id']).and_return({apps: [ops_works_app]}
49
+ expect(client).to receive(:describe_apps).with(app_ids: ['app-id']).and_return({apps: [ops_works_app]}
50
50
  )
51
- client.should_receive(:create_deployment).with(
51
+ expect(client).to receive(:create_deployment).with(
52
52
  stack_id: 'stack-id', app_id: 'app-id', command: {name: 'deploy'}, comment: 'Deploy build 123 via Travis CI', custom_json: custom_json
53
53
  ).and_return({})
54
54
  provider.push_app
@@ -57,8 +57,8 @@ describe DPL::Provider::OpsWorks do
57
57
  let(:custom_json_with_migrate) { "{\"deploy\":{\"app\":{\"migrate\":true,\"scm\":{\"revision\":\"sha\"}}}}" }
58
58
  example 'with :migrate option' do
59
59
  provider.options.update(app_id: 'app-id', migrate: true)
60
- client.should_receive(:describe_apps).with(app_ids: ['app-id']).and_return({apps: [ops_works_app]})
61
- client.should_receive(:create_deployment).with(
60
+ expect(client).to receive(:describe_apps).with(app_ids: ['app-id']).and_return({apps: [ops_works_app]})
61
+ expect(client).to receive(:create_deployment).with(
62
62
  stack_id: 'stack-id', app_id: 'app-id', command: {name: 'deploy'}, comment: 'Deploy build 123 via Travis CI', custom_json: custom_json_with_migrate
63
63
  ).and_return({})
64
64
  provider.push_app
@@ -66,16 +66,16 @@ describe DPL::Provider::OpsWorks do
66
66
 
67
67
  example 'with :wait_until_deployed' do
68
68
  provider.options.update(app_id: 'app-id', wait_until_deployed: true)
69
- client.should_receive(:describe_apps).with(app_ids: ['app-id']).and_return({apps: [ops_works_app]})
70
- client.should_receive(:create_deployment).and_return({deployment_id: 'deployment_id'})
71
- client.should_receive(:describe_deployments).with({deployment_ids: ['deployment_id']}).and_return({deployments: [status: 'running']}, {deployments: [status: 'successful']})
69
+ expect(client).to receive(:describe_apps).with(app_ids: ['app-id']).and_return({apps: [ops_works_app]})
70
+ expect(client).to receive(:create_deployment).and_return({deployment_id: 'deployment_id'})
71
+ expect(client).to receive(:describe_deployments).with({deployment_ids: ['deployment_id']}).and_return({deployments: [status: 'running']}, {deployments: [status: 'successful']})
72
72
  provider.push_app
73
73
  end
74
74
  end
75
75
 
76
- describe :api do
76
+ describe "#api" do
77
77
  example do
78
- AWS::OpsWorks.should_receive(:new)
78
+ expect(AWS::OpsWorks).to receive(:new)
79
79
  provider.api
80
80
  end
81
81
  end
@@ -6,66 +6,66 @@ describe DPL::Provider::PyPI do
6
6
  described_class.new(DummyContext.new, :user => 'foo', :password => 'bar')
7
7
  end
8
8
 
9
- describe :config do
9
+ describe "#config" do
10
10
  it 'accepts a user and a password' do
11
- provider.config[:servers]['pypi'].should include 'username: foo'
12
- provider.config[:servers]['pypi'].should include 'password: bar'
11
+ expect(provider.config[:servers]['pypi']).to include 'username: foo'
12
+ expect(provider.config[:servers]['pypi']).to include 'password: bar'
13
13
  end
14
14
  end
15
15
 
16
- describe :initialize do
16
+ describe "#initialize" do
17
17
  example "with :distributions option containing 'bdist_wheel'" do
18
- described_class.should_receive(:pip).with("wheel")
18
+ expect(described_class).to receive(:pip).with("wheel")
19
19
  described_class.new(DummyContext.new, :user => 'foo', :password => 'bar', :distributions => 'bdist_wheel sdist')
20
20
  end
21
21
  end
22
22
 
23
- describe :check_auth do
23
+ describe "#check_auth" do
24
24
  example do
25
- provider.should_receive(:log).with("Authenticated as foo")
25
+ expect(provider).to receive(:log).with("Authenticated as foo")
26
26
  provider.check_auth
27
27
  end
28
28
  end
29
29
 
30
- describe :push_app do
30
+ describe "#push_app" do
31
31
  example do
32
- provider.context.should_receive(:shell).with("python setup.py register -r pypi")
33
- provider.context.should_receive(:shell).with("python setup.py sdist upload -r pypi")
34
- provider.context.should_receive(:shell).with("python setup.py upload_docs --upload-dir build/docs")
32
+ expect(provider.context).to receive(:shell).with("python setup.py register -r pypi")
33
+ expect(provider.context).to receive(:shell).with("python setup.py sdist upload -r pypi")
34
+ expect(provider.context).to receive(:shell).with("python setup.py upload_docs --upload-dir build/docs")
35
35
  provider.push_app
36
36
  end
37
37
 
38
38
  example "with :distributions option" do
39
39
  provider.options.update(:distributions => 'sdist bdist')
40
- provider.context.should_receive(:shell).with("python setup.py register -r pypi")
41
- provider.context.should_receive(:shell).with("python setup.py sdist bdist upload -r pypi")
42
- provider.context.should_receive(:shell).with("python setup.py upload_docs --upload-dir build/docs")
40
+ expect(provider.context).to receive(:shell).with("python setup.py register -r pypi")
41
+ expect(provider.context).to receive(:shell).with("python setup.py sdist bdist upload -r pypi")
42
+ expect(provider.context).to receive(:shell).with("python setup.py upload_docs --upload-dir build/docs")
43
43
  provider.push_app
44
44
  end
45
45
 
46
46
  example "with :server option" do
47
47
  provider.options.update(:server => 'http://blah.com')
48
- provider.context.should_receive(:shell).with("python setup.py register -r http://blah.com")
49
- provider.context.should_receive(:shell).with("python setup.py sdist upload -r http://blah.com")
50
- provider.context.should_receive(:shell).with("python setup.py upload_docs --upload-dir build/docs")
48
+ expect(provider.context).to receive(:shell).with("python setup.py register -r http://blah.com")
49
+ expect(provider.context).to receive(:shell).with("python setup.py sdist upload -r http://blah.com")
50
+ expect(provider.context).to receive(:shell).with("python setup.py upload_docs --upload-dir build/docs")
51
51
  provider.push_app
52
52
  end
53
53
 
54
54
  example "with :docs_dir option" do
55
55
  provider.options.update(:docs_dir => 'some/dir')
56
- provider.context.should_receive(:shell).with("python setup.py register -r pypi")
57
- provider.context.should_receive(:shell).with("python setup.py sdist upload -r pypi")
58
- provider.context.should_receive(:shell).with("python setup.py upload_docs --upload-dir some/dir")
56
+ expect(provider.context).to receive(:shell).with("python setup.py register -r pypi")
57
+ expect(provider.context).to receive(:shell).with("python setup.py sdist upload -r pypi")
58
+ expect(provider.context).to receive(:shell).with("python setup.py upload_docs --upload-dir some/dir")
59
59
  provider.push_app
60
60
  end
61
61
  end
62
62
 
63
- describe :write_servers do
63
+ describe "#write_servers" do
64
64
  example do
65
65
  f = double(:f)
66
- f.should_receive(:puts).with(" pypi")
67
- f.should_receive(:puts).with("[pypi]")
68
- f.should_receive(:puts).with(["repository: http://pypi.python.org/pypi",
66
+ expect(f).to receive(:puts).with(" pypi")
67
+ expect(f).to receive(:puts).with("[pypi]")
68
+ expect(f).to receive(:puts).with(["repository: http://pypi.python.org/pypi",
69
69
  "username: foo",
70
70
  "password: bar"
71
71
  ])
@@ -7,11 +7,11 @@ describe DPL::Provider::Releases do
7
7
  described_class.new(DummyContext.new, :api_key => '0123445789qwertyuiop0123445789qwertyuiop', :file => 'blah.txt')
8
8
  end
9
9
 
10
- describe :api do
10
+ describe "#api" do
11
11
  example "With API key" do
12
12
  api = double(:api)
13
- ::Octokit::Client.should_receive(:new).with(:access_token => '0123445789qwertyuiop0123445789qwertyuiop').and_return(api)
14
- provider.api.should be == api
13
+ expect(::Octokit::Client).to receive(:new).with(:access_token => '0123445789qwertyuiop0123445789qwertyuiop').and_return(api)
14
+ expect(provider.api).to eq(api)
15
15
  end
16
16
 
17
17
  example "With username and password" do
@@ -19,75 +19,75 @@ describe DPL::Provider::Releases do
19
19
  provider.options.update(:user => 'foo')
20
20
  provider.options.update(:password => 'bar')
21
21
 
22
- ::Octokit::Client.should_receive(:new).with(:login => 'foo', :password => 'bar').and_return(api)
23
- provider.api.should be == api
22
+ expect(::Octokit::Client).to receive(:new).with(:login => 'foo', :password => 'bar').and_return(api)
23
+ expect(provider.api).to eq(api)
24
24
  end
25
25
  end
26
26
 
27
- describe :releases do
27
+ describe "#releases" do
28
28
  example "With ENV Slug" do
29
- provider.stub(:slug).and_return("foo/bar")
29
+ allow(provider).to receive(:slug).and_return("foo/bar")
30
30
 
31
- provider.api.should_receive(:releases).with("foo/bar")
31
+ expect(provider.api).to receive(:releases).with("foo/bar")
32
32
  provider.releases
33
33
  end
34
34
 
35
35
  example "With repo option" do
36
36
  provider.options.update(:repo => 'bar/foo')
37
37
 
38
- provider.api.should_receive(:releases).with('bar/foo')
38
+ expect(provider.api).to receive(:releases).with('bar/foo')
39
39
  provider.releases
40
40
  end
41
41
  end
42
42
 
43
- describe :needs_key? do
43
+ describe "#needs_key?" do
44
44
  example do
45
- provider.needs_key?.should == false
45
+ expect(provider.needs_key?).to eq(false)
46
46
  end
47
47
  end
48
48
 
49
- describe :check_auth do
49
+ describe "#check_auth" do
50
50
  example "With proper permissions" do
51
51
  allow_message_expectations_on_nil
52
- provider.stub(:user)
53
- provider.stub(:setup_auth)
54
- provider.api.should_receive(:scopes).and_return(["public_repo"])
55
- provider.user.should_receive(:name).and_return("foo")
56
- provider.should_receive(:log).with("Logged in as foo")
52
+ allow(provider).to receive(:user)
53
+ allow(provider).to receive(:setup_auth)
54
+ expect(provider.api).to receive(:scopes).and_return(["public_repo"])
55
+ expect(provider.user).to receive(:name).and_return("foo")
56
+ expect(provider).to receive(:log).with("Logged in as foo")
57
57
  provider.check_auth
58
58
  end
59
59
 
60
60
  example "With improper permissions" do
61
61
  allow_message_expectations_on_nil
62
- provider.stub(:user)
63
- provider.stub(:setup_auth)
64
- provider.api.should_receive(:scopes).exactly(2).times.and_return([])
62
+ allow(provider).to receive(:user)
63
+ allow(provider).to receive(:setup_auth)
64
+ expect(provider.api).to receive(:scopes).exactly(2).times.and_return([])
65
65
  expect { provider.check_auth }.to raise_error(DPL::Error)
66
66
  end
67
67
  end
68
68
 
69
- describe :push_app do
69
+ describe "#push_app" do
70
70
  example "When Release Exists but has no Files" do
71
71
  allow_message_expectations_on_nil
72
72
 
73
73
  provider.options.update(:file => ["test/foo.bar", "bar.foo"])
74
74
 
75
- provider.stub(:releases).and_return([""])
76
- provider.stub(:get_tag).and_return("v0.0.0")
75
+ allow(provider).to receive(:releases).and_return([""])
76
+ allow(provider).to receive(:get_tag).and_return("v0.0.0")
77
77
 
78
- provider.releases.map do |release|
79
- release.stub(:tag_name).and_return("v0.0.0")
80
- release.stub(:rels).and_return({:self => nil})
81
- release.rels[:self].stub(:href)
78
+ provider.releases.map do |release|
79
+ allow(release).to receive(:tag_name).and_return("v0.0.0")
80
+ allow(release).to receive(:rels).and_return({:self => nil})
81
+ allow(release.rels[:self]).to receive(:href)
82
82
  end
83
83
 
84
- provider.api.stub(:release)
85
- provider.api.release.stub(:rels).and_return({:assets => nil})
86
- provider.api.release.rels[:assets].stub(:get).and_return({:data => [""]})
87
- provider.api.release.rels[:assets].get.stub(:data).and_return([])
84
+ allow(provider.api).to receive(:release)
85
+ allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
86
+ allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => [""]})
87
+ allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
88
88
 
89
- provider.api.should_receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
90
- provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
89
+ expect(provider.api).to receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
90
+ expect(provider.api).to receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
91
91
 
92
92
  provider.push_app
93
93
  end
@@ -97,22 +97,22 @@ describe DPL::Provider::Releases do
97
97
 
98
98
  provider.options.update(:file => ["test/foo.bar", "bar.foo"])
99
99
 
100
- provider.stub(:releases).and_return([""])
101
- provider.stub(:get_tag).and_return("v0.0.0")
100
+ allow(provider).to receive(:releases).and_return([""])
101
+ allow(provider).to receive(:get_tag).and_return("v0.0.0")
102
102
 
103
- provider.releases.map do |release|
104
- release.stub(:tag_name).and_return("v0.0.0")
105
- release.stub(:rels).and_return({:self => nil})
106
- release.rels[:self].stub(:href)
103
+ provider.releases.map do |release|
104
+ allow(release).to receive(:tag_name).and_return("v0.0.0")
105
+ allow(release).to receive(:rels).and_return({:self => nil})
106
+ allow(release.rels[:self]).to receive(:href)
107
107
  end
108
108
 
109
- provider.api.stub(:release)
110
- provider.api.release.stub(:rels).and_return({:assets => nil})
111
- provider.api.release.rels[:assets].stub(:get).and_return({:data => [""]})
112
- provider.api.release.rels[:assets].get.stub(:data).and_return([double(:name => "foo.bar"), double(:name => "foo.foo")])
109
+ allow(provider.api).to receive(:release)
110
+ allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
111
+ allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => [""]})
112
+ allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([double(:name => "foo.bar"), double(:name => "foo.foo")])
113
113
 
114
- provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
115
- provider.should_receive(:log).with("foo.bar already exists, skipping.")
114
+ expect(provider.api).to receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
115
+ expect(provider).to receive(:log).with("foo.bar already exists, skipping.")
116
116
 
117
117
  provider.push_app
118
118
  end
@@ -122,25 +122,25 @@ describe DPL::Provider::Releases do
122
122
 
123
123
  provider.options.update(:file => ["test/foo.bar", "bar.foo"])
124
124
 
125
- provider.stub(:releases).and_return([""])
126
-
127
- provider.releases.map do |release|
128
- release.stub(:tag_name).and_return("foo")
129
- release.stub(:rels).and_return({:self => nil})
130
- release.rels[:self].stub(:href)
125
+ allow(provider).to receive(:releases).and_return([""])
126
+
127
+ provider.releases.map do |release|
128
+ allow(release).to receive(:tag_name).and_return("foo")
129
+ allow(release).to receive(:rels).and_return({:self => nil})
130
+ allow(release.rels[:self]).to receive(:href)
131
131
  end
132
132
 
133
- provider.api.stub(:create_release)
134
- provider.api.create_release.stub(:rels).and_return({:self => nil})
135
- provider.api.create_release.rels[:slef].stub(:href)
133
+ allow(provider.api).to receive(:create_release)
134
+ allow(provider.api.create_release).to receive(:rels).and_return({:self => nil})
135
+ allow(provider.api.create_release.rels[:slef]).to receive(:href)
136
136
 
137
- provider.api.stub(:release)
138
- provider.api.release.stub(:rels).and_return({:assets => nil})
139
- provider.api.release.rels[:assets].stub(:get).and_return({:data => nil})
140
- provider.api.release.rels[:assets].get.stub(:data).and_return([])
137
+ allow(provider.api).to receive(:release)
138
+ allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
139
+ allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
140
+ allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
141
141
 
142
- provider.api.should_receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
143
- provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
142
+ expect(provider.api).to receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
143
+ expect(provider.api).to receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
144
144
 
145
145
  provider.push_app
146
146
  end
@@ -151,14 +151,14 @@ describe DPL::Provider::Releases do
151
151
  provider.options.update(:file => ["bar.foo"])
152
152
  provider.options.update(:release_number => "1234")
153
153
 
154
- provider.stub(:slug).and_return("foo/bar")
154
+ allow(provider).to receive(:slug).and_return("foo/bar")
155
155
 
156
- provider.api.stub(:release)
157
- provider.api.release.stub(:rels).and_return({:assets => nil})
158
- provider.api.release.rels[:assets].stub(:get).and_return({:data => nil})
159
- provider.api.release.rels[:assets].get.stub(:data).and_return([])
156
+ allow(provider.api).to receive(:release)
157
+ allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
158
+ allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
159
+ allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
160
160
 
161
- provider.api.should_receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.foo", {:name=>"bar.foo", :content_type=>""})
161
+ expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.foo", {:name=>"bar.foo", :content_type=>""})
162
162
 
163
163
  provider.push_app
164
164
  end