rainforest-cli 1.1.3 → 1.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 270928ed835e7dbed583470fff3b9c1986e5fe9a
4
- data.tar.gz: fc60894506391ac1e329b5fb9961fddd920da227
3
+ metadata.gz: 64c92d088ca6ebcc0b9b64ec565c28755a5c3179
4
+ data.tar.gz: ce73f06786865a973aa5db835458d88b4bd4edc5
5
5
  SHA512:
6
- metadata.gz: 3e395a458362b9d1d2c55d3622655d0fc0f9576a713023f0c1b809c786eaa6bff3a9a606057b032d21db08d92017db542b621a59951d7bdea88ee21dd77afd80
7
- data.tar.gz: a719238a0aa11bf602c1ff21ee56799380363d1145ce59f8fa38f1f2e18f8099a7defc02bf462a9745c2a2341c5774813bee4bfbf28c2becebedfeb1d2f73725
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 - 15th January 2016
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?(SPEC_FOLDER)
29
- logger.fatal "Rainforest folder not found (#{SPEC_FOLDER})"
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("#{SPEC_FOLDER}/**/*#{EXT}").each do |file_name|
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([SPEC_FOLDER, name])
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
 
@@ -1,3 +1,3 @@
1
1
  module RainforestCli
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
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" }
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.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu