admin-cf-plugin 0.2.0 → 0.2.1.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/admin-cf-plugin/version.rb +1 -1
- data/spec/curl_spec.rb +6 -15
- data/spec/spec_helper.rb +3 -2
- metadata +17 -11
data/spec/curl_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
3
|
+
describe CFAdmin::Curl do
|
4
4
|
let(:fake_home_dir) { "#{SPEC_ROOT}/fixtures/fake_home_dir" }
|
5
5
|
|
6
6
|
stub_home_dir_with { fake_home_dir }
|
@@ -8,10 +8,8 @@ command CFAdmin::Curl do
|
|
8
8
|
let(:client) { fake_client }
|
9
9
|
|
10
10
|
context "when the response is JSON" do
|
11
|
-
subject { cf %W[curl GET /foo] }
|
12
|
-
|
13
11
|
it "pretty-prints the response" do
|
14
|
-
stub_request(:get, "
|
12
|
+
stub_request(:get, "https://api.some-target-for-cf-curl.com/foo").to_return(
|
15
13
|
:headers => {
|
16
14
|
"content-type" => "application/json; charset=utf8"
|
17
15
|
},
|
@@ -19,8 +17,7 @@ command CFAdmin::Curl do
|
|
19
17
|
:body => '{"foo":"bar"}'
|
20
18
|
)
|
21
19
|
|
22
|
-
|
23
|
-
|
20
|
+
cf %W[curl GET /foo]
|
24
21
|
expect(output).to say(<<OUT)
|
25
22
|
{
|
26
23
|
"foo": "bar"
|
@@ -30,31 +27,25 @@ OUT
|
|
30
27
|
end
|
31
28
|
|
32
29
|
context "with an implicit target" do
|
33
|
-
subject { cf %W[curl GET /apps/5/instances] }
|
34
|
-
|
35
30
|
it "makes a request to the current target" do
|
36
|
-
stub_request(:get, "
|
31
|
+
stub_request(:get, "https://api.some-target-for-cf-curl.com/apps/5/instances").to_return(
|
37
32
|
:status => 200,
|
38
33
|
:body => 'some-body'
|
39
34
|
)
|
40
35
|
|
41
|
-
|
42
|
-
|
36
|
+
cf %W[curl GET /apps/5/instances]
|
43
37
|
expect(output).to say("some-body")
|
44
38
|
end
|
45
39
|
end
|
46
40
|
|
47
41
|
context "with an explicit target" do
|
48
|
-
subject { cf %W[curl GET https://some-other-domain.com/apps/5/instances] }
|
49
|
-
|
50
42
|
it "makes a request to the given target" do
|
51
43
|
stub_request(:get, "https://some-other-domain.com/apps/5/instances").to_return(
|
52
44
|
:status => 200,
|
53
45
|
:body => 'some-other-body'
|
54
46
|
)
|
55
47
|
|
56
|
-
|
57
|
-
|
48
|
+
cf %W[curl GET https://some-other-domain.com/apps/5/instances]
|
58
49
|
expect(output).to say("some-other-body")
|
59
50
|
end
|
60
51
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,6 +6,7 @@ require "cfoundry"
|
|
6
6
|
require "cfoundry/test_support"
|
7
7
|
require "webmock/rspec"
|
8
8
|
require "cf/test_support"
|
9
|
+
require "blue-shell"
|
9
10
|
|
10
11
|
require "#{SPEC_ROOT}/../lib/admin-cf-plugin/plugin"
|
11
12
|
|
@@ -14,6 +15,6 @@ RSpec.configure do |c|
|
|
14
15
|
c.mock_with :rr
|
15
16
|
|
16
17
|
c.include FakeHomeDir
|
17
|
-
c.include
|
18
|
-
c.include
|
18
|
+
c.include CliHelper
|
19
|
+
c.include BlueShell::Matchers
|
19
20
|
end
|
metadata
CHANGED
@@ -1,32 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: admin-cf-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1.rc1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alex Suraci
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cfoundry
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.7.0.rc4
|
22
|
+
- - <
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0.8'
|
22
25
|
type: :runtime
|
23
26
|
prerelease: false
|
24
27
|
version_requirements: !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
29
|
requirements:
|
27
|
-
- -
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.7.0.rc4
|
33
|
+
- - <
|
28
34
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
35
|
+
version: '0.8'
|
30
36
|
description:
|
31
37
|
email:
|
32
38
|
- asuraci@vmware.com
|
@@ -57,16 +63,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
63
|
version: '0'
|
58
64
|
segments:
|
59
65
|
- 0
|
60
|
-
hash:
|
66
|
+
hash: 2280302230589950405
|
61
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
68
|
none: false
|
63
69
|
requirements:
|
64
|
-
- - ! '
|
70
|
+
- - ! '>'
|
65
71
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
72
|
+
version: 1.3.1
|
67
73
|
requirements: []
|
68
74
|
rubyforge_project: admin-cf-plugin
|
69
|
-
rubygems_version: 1.8.
|
75
|
+
rubygems_version: 1.8.24
|
70
76
|
signing_key:
|
71
77
|
specification_version: 3
|
72
78
|
summary: Cloud Foundry administration commands.
|