rainforest-cli 1.1.3 → 1.1.4
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 +6 -1
- data/lib/rainforest/cli/test_importer.rb +4 -4
- data/lib/rainforest/cli/version.rb +1 -1
- data/spec/options_spec.rb +10 -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: 64c92d088ca6ebcc0b9b64ec565c28755a5c3179
|
4
|
+
data.tar.gz: ce73f06786865a973aa5db835458d88b4bd4edc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86ee464ee5745117353fb673682355aed50361b31b76a01b97dce5f4e34817e2439f5bd0a7467f511f80956b93e2ef32c87e349d4dbd24970a804c0b82e09da1
|
7
|
+
data.tar.gz: f91efb44badfae00246e3a9d2d991242af873eed47c800330fd9c8a1f94d131a9d22f76ac6fe0c3119e6308bfed73ecd297a611ac17027d37501c18bc3651bcb
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rainforest CLI Changelog
|
2
2
|
|
3
|
-
## 1.1.
|
3
|
+
## 1.1.4 - 15th January 2016
|
4
4
|
- Customizable folder location for rainforest tests (fa4418738311cee8ca25cbb22a8ca52aa9cbd873, @ukd1)
|
5
5
|
- Update valid browser list, though this doesn't include custom browsers today (e6195c42f95cce72a17f49643bfe8c297baf8dd9, @ukd1)
|
6
6
|
|
@@ -12,7 +12,7 @@ module RainforestCli
|
|
12
12
|
attr_writer :file_name, :tags
|
13
13
|
attr_reader :command, :token, :tags, :conflict, :browsers, :site_id, :environment_id,
|
14
14
|
:import_file_name, :import_name, :custom_url, :description, :folder,
|
15
|
-
:debug, :file_name
|
15
|
+
:debug, :file_name, :test_spec_folder
|
16
16
|
|
17
17
|
# Note, not all of these may be available to your account
|
18
18
|
# also, we may remove this in the future.
|
@@ -24,6 +24,7 @@ module RainforestCli
|
|
24
24
|
@browsers = nil
|
25
25
|
@require_token = true
|
26
26
|
@debug = false
|
27
|
+
@test_spec_folder = RainforestCli::TestImporter::SPEC_FOLDER
|
27
28
|
|
28
29
|
@parsed = ::OptionParser.new do |opts|
|
29
30
|
opts.on("--debug") do
|
@@ -34,6 +35,10 @@ module RainforestCli
|
|
34
35
|
@file_name = value
|
35
36
|
end
|
36
37
|
|
38
|
+
opts.on("--test-folder spec/rainforest", "Specify the test folder. Defaults to spec/rainforest if not set.") do |value|
|
39
|
+
@test_spec_folder = value
|
40
|
+
end
|
41
|
+
|
37
42
|
opts.on("--import-variable-csv-file FILE", "Import step variables; CSV data") do |value|
|
38
43
|
@import_file_name = value
|
39
44
|
end
|
@@ -25,8 +25,8 @@ EOF
|
|
25
25
|
|
26
26
|
def initialize(options)
|
27
27
|
@options = options
|
28
|
-
unless File.exists?(
|
29
|
-
logger.fatal "Rainforest folder not found (#{
|
28
|
+
unless File.exists?(@options.test_spec_folder)
|
29
|
+
logger.fatal "Rainforest test folder not found (#{@options.test_spec_folder})"
|
30
30
|
exit 2
|
31
31
|
end
|
32
32
|
end
|
@@ -185,7 +185,7 @@ EOF
|
|
185
185
|
tests = {}
|
186
186
|
has_errors = []
|
187
187
|
|
188
|
-
Dir.glob("#{
|
188
|
+
Dir.glob("#{@options.test_spec_folder}/**/*#{EXT}").each do |file_name|
|
189
189
|
out = RainforestCli::TestParser::Parser.new(File.read(file_name)).process
|
190
190
|
|
191
191
|
tests[file_name] = out
|
@@ -228,7 +228,7 @@ EOF
|
|
228
228
|
uuid = SecureRandom.uuid
|
229
229
|
name = "#{uuid}#{EXT}" unless name
|
230
230
|
name += EXT unless name[-EXT.length..-1] == EXT
|
231
|
-
name = File.join([
|
231
|
+
name = File.join([@options.test_spec_folder, name])
|
232
232
|
|
233
233
|
File.open(name, "w") { |file| file.write(sprintf(SAMPLE_FILE, uuid)) }
|
234
234
|
|
data/spec/options_spec.rb
CHANGED
@@ -7,6 +7,16 @@ describe RainforestCli::OptionParser do
|
|
7
7
|
its(:import_file_name) { should == "some_file.csv" }
|
8
8
|
end
|
9
9
|
|
10
|
+
context "test folder (when passed)" do
|
11
|
+
let(:args) { ["--test-folder", "/path/to/folder"] }
|
12
|
+
its(:test_spec_folder) { should == "/path/to/folder" }
|
13
|
+
end
|
14
|
+
|
15
|
+
context "test folder (when not passed)" do
|
16
|
+
let(:args) { [] }
|
17
|
+
its(:test_spec_folder) { should == RainforestCli::TestImporter::SPEC_FOLDER }
|
18
|
+
end
|
19
|
+
|
10
20
|
context "importing name" do
|
11
21
|
let(:args) { ["--import-variable-name", "some_name"] }
|
12
22
|
its(:import_name) { should == "some_name" }
|