rainforest-cli 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/rainforest/cli/options.rb +5 -1
- data/lib/rainforest/cli/runner.rb +2 -0
- data/lib/rainforest/cli/version.rb +1 -1
- data/spec/cli_spec.rb +14 -0
- data/spec/options_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de69b9d90b2a8b1ddfc19cf287245431f5ae3ed7
|
4
|
+
data.tar.gz: c2f08b36e64d29337297b9ef41dc772ef1788ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ec6367a9685646ced80f2c86c9696388b9dc8df22c8795899458f2a404e8d0a938b12338dbcfa1fc0adea09981e52e8c79b73fd2e1daeb522a209a15ad46df
|
7
|
+
data.tar.gz: 4766ea01f10850422ea14a176d3b46473b057a8cd1819e2d54d5bb6432dd763d447629728ac61941270fee8d96b429ac0732892f92a7ea7bff5f9de5c53d84a6
|
data/CHANGELOG.md
CHANGED
@@ -10,7 +10,7 @@ module Rainforest
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class OptionParser
|
13
|
-
attr_reader :command, :token, :tags, :conflict, :browsers, :site_id,
|
13
|
+
attr_reader :command, :token, :tags, :conflict, :browsers, :site_id, :environment_id,
|
14
14
|
:import_file_name, :import_name, :custom_url, :description
|
15
15
|
|
16
16
|
VALID_BROWSERS = %w{chrome firefox safari ie8 ie9}.freeze
|
@@ -59,6 +59,10 @@ module Rainforest
|
|
59
59
|
@conflict = value
|
60
60
|
end
|
61
61
|
|
62
|
+
opts.on("--environment-id ID", Integer, "Run using this environment. If excluded, will use your default") do |value|
|
63
|
+
@environment_id = value
|
64
|
+
end
|
65
|
+
|
62
66
|
opts.on("--site-id ID", Integer, "Only run tests for a specific site") do |value|
|
63
67
|
@site_id = value
|
64
68
|
end
|
data/spec/cli_spec.rb
CHANGED
@@ -144,6 +144,20 @@ describe Rainforest::Cli do
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
|
+
context "with environment-id" do
|
148
|
+
let(:params) { %w(--token x --environment 123) }
|
149
|
+
|
150
|
+
it "starts the run with environment_id" do
|
151
|
+
Rainforest::Cli::Runner.any_instance.stub(get_environment_id: 333)
|
152
|
+
|
153
|
+
http_client.should_receive(:post).with(
|
154
|
+
"/runs",
|
155
|
+
{ :tests=>[], :environment_id=>123 }
|
156
|
+
).and_return( {} )
|
157
|
+
described_class.start(params)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
147
161
|
context "a simple run" do
|
148
162
|
before do
|
149
163
|
http_client.stub(:post) { {"id" => 1} }
|
data/spec/options_spec.rb
CHANGED
@@ -74,6 +74,11 @@ describe Rainforest::Cli::OptionParser do
|
|
74
74
|
its(:site_id) { should eq 3 }
|
75
75
|
end
|
76
76
|
|
77
|
+
context "it parses the environment-id flag" do
|
78
|
+
let(:args) { ["run", "--environment-id", '3'] }
|
79
|
+
its(:environment_id) { should eq 3 }
|
80
|
+
end
|
81
|
+
|
77
82
|
context "it parses the custom-url flag" do
|
78
83
|
let(:args) { ["run", "--custom-url", 'http://ad-hoc.example.com'] }
|
79
84
|
its(:custom_url) { should eq 'http://ad-hoc.example.com' }
|