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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88505e3ffad882766d2d703e1bccee7e5d172ac5
4
- data.tar.gz: d1e94e80fa0d25c63acfc77af358725cf64b017a
3
+ metadata.gz: de69b9d90b2a8b1ddfc19cf287245431f5ae3ed7
4
+ data.tar.gz: c2f08b36e64d29337297b9ef41dc772ef1788ed3
5
5
  SHA512:
6
- metadata.gz: 76924d0b6b70887ed76c33a1fa5ee0a43cd4e7cee64a7a2b8e6b475fd079d6ecb1d973985714c5d0e9e9a68e315fe174e0887d9c934178a397094b81a4294708
7
- data.tar.gz: 1f3507c3f696038a2b573881c12d098992d625cd2c15d7b05e7344f67abb42f88f35fcfe1cd461291762ad41f761fcefc280d42037f586ec4327ff3435655b9f
6
+ metadata.gz: e9ec6367a9685646ced80f2c86c9696388b9dc8df22c8795899458f2a404e8d0a938b12338dbcfa1fc0adea09981e52e8c79b73fd2e1daeb522a209a15ad46df
7
+ data.tar.gz: 4766ea01f10850422ea14a176d3b46473b057a8cd1819e2d54d5bb6432dd763d447629728ac61941270fee8d96b429ac0732892f92a7ea7bff5f9de5c53d84a6
@@ -1,6 +1,6 @@
1
1
  # Rainforest CLI Changelog
2
2
 
3
- ## 1.0.4 - 25th August 2015
3
+ ## 1.0.5 - 25th August 2015
4
4
  - Added environment support (278f4fe9a1ca9f507fe1e4b11935d9c37056786b)
5
5
 
6
6
  ## 0.0.11 - 30th Sept 2013
@@ -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
@@ -104,6 +104,8 @@ module Rainforest
104
104
 
105
105
  if options.custom_url
106
106
  post_opts[:environment_id] = get_environment_id(options.custom_url)
107
+ elsif options.environment_id
108
+ post_opts[:environment_id] = options.environment_id
107
109
  end
108
110
 
109
111
  post_opts
@@ -1,5 +1,5 @@
1
1
  module Rainforest
2
2
  module Cli
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -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} }
@@ -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' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rainforest-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu