rainforest-cli 1.6.4 → 1.6.5

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: e77dec4702b93e1e965863ef17de691657fd03ae
4
- data.tar.gz: 578b1fa55a182adf52f74c1f2201219c4af1c72a
3
+ metadata.gz: 70b20280040fce6f6790e5e18149596eccb2824e
4
+ data.tar.gz: 1f83c0cc0e433bfc36baf775023c0b3f7f49780d
5
5
  SHA512:
6
- metadata.gz: 2f9ff110e6d916871ad66b1c47ab4e19c02392629a97f9c5de5f7ad8337382a3b068dad60252163ecc31be684cc5aaa53d1b4c162b685298f2b01a5f1abbd8ea
7
- data.tar.gz: 09a7e1779f9cec02042ee8845ae9f89a7e99718b8245f7a45f65bdd4beffe162d1819afae81557cdd923756b3888a42d5ab2765338478aa3f14a0457732b54f4
6
+ metadata.gz: d9a8325fe43ba3a84017701f0ab3be81bad42c7e6bd04853909835a7afa2fa3867e8e4e91320fa24c6549df9691015003b6a25c5c141a8c12754523be4ae3051
7
+ data.tar.gz: 9be91de080050e86660f0962d534d97632f22298f5240747e52aa05855e7cfa961daa0d21002794641409dd9731909425351ecba3d047c9677c0b4daa57996c4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Rainforest CLI Changelog
2
2
 
3
+ ## 1.6.5 - 13th June 2016
4
+ - Exit with non-zero status code when `validate` fails. (8db1d38be39aa50d2afcdef817f78c654b3108b6,
5
+ @DyerSituation)
6
+ - Increase the amount of folders fetched from API to 100. (7fc7d426c029d35e73fe45712a79b35fda54ad60,
7
+ @DyerSituation)
8
+
3
9
  ## 1.6.4 - 10th June 2016
4
10
  - Add redirects to non-embedded steps that need them as well. (2a5918d1a448f78016587c1711261e90a7be120f,
5
11
  @epaulet)
@@ -7,7 +13,7 @@
7
13
  (b604a5607e707057375ecc14db836d4b3ec537b1, @epaulet)
8
14
 
9
15
  ## 1.6.3 - 9th June 2016
10
- - Add redirects to exported steps. (ccbdaec2a9fb52c775ffbee05e203e1026b256f7, @theonegri)
16
+ - Add redirects to exported embedded tests. (ccbdaec2a9fb52c775ffbee05e203e1026b256f7, @theonegri)
11
17
 
12
18
  ## 1.6.2 - 8th June 2016
13
19
  - Lower concurrent thread count to 16 and allow users to modify the amount of threads used.
@@ -18,8 +18,7 @@ class RainforestCli::Resources
18
18
  end
19
19
 
20
20
  def folders
21
- folders = @client.get('/folders').map { |f| Resource.new(f['id'], f['title']) }
22
-
21
+ folders = @client.get('/folders?page_size=100').map { |f| Resource.new(f['id'], f['title']) }
23
22
  if folders.empty?
24
23
  logger.info('No folders found on your account.')
25
24
  logger.info('Please visit https://app.rainforestqa.com/folders to create and edit your sites.')
@@ -13,7 +13,7 @@ class RainforestCli::Validator
13
13
 
14
14
  def validate
15
15
  check_test_directory_for_tests!
16
- invalid?
16
+ exit 1 if invalid?
17
17
  end
18
18
 
19
19
  def validate_with_exception!
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module RainforestCli
3
- VERSION = '1.6.4'
3
+ VERSION = '1.6.5'
4
4
  end
@@ -82,7 +82,17 @@ describe RainforestCli::Resources do
82
82
  let(:expected_name) { api_response.first['title'] }
83
83
 
84
84
  it_should_behave_like 'a properly formatted resource', :folders
85
+
86
+
87
+ it 'should make a get request for 100 pages' do
88
+ expect_any_instance_of(RainforestCli::HttpClient).to receive(:get) do |_obj, message|
89
+ expect(message).to include('page_size=100')
90
+ end.and_return(api_response)
91
+ subject.folders
92
+ end
85
93
  end
94
+
95
+
86
96
  end
87
97
 
88
98
  describe '#browsers' do
@@ -8,11 +8,7 @@ describe RainforestCli::Validator do
8
8
  .with(array_including(test_with_file_name(file_path)))
9
9
  .and_call_original
10
10
 
11
- if raises_error
12
- expect { subject.public_send(tested_method) }.to raise_error(SystemExit)
13
- else
14
- expect { subject.public_send(tested_method) }.to_not raise_error
15
- end
11
+ expect { subject.public_send(tested_method) }.to raise_error(SystemExit)
16
12
  end
17
13
 
18
14
  def does_not_notify_for_wrong_file_names
@@ -20,16 +16,11 @@ describe RainforestCli::Validator do
20
16
  .with(array_excluding(test_with_file_name(file_path)))
21
17
  .and_call_original
22
18
 
23
- if raises_error
24
- expect { subject.public_send(tested_method) }.to raise_error(SystemExit)
25
- else
26
- expect { subject.public_send(tested_method) }.to_not raise_error
27
- end
19
+ expect { subject.public_send(tested_method) }.to raise_error(SystemExit)
28
20
  end
29
21
 
30
22
  shared_examples 'it detects all the correct errors' do
31
23
  let(:tested_method) { :validate }
32
- let(:raises_error) { false }
33
24
  let(:options) { instance_double('RainforestCli::Options', test_folder: test_directory, token: 'api_token', command: '') }
34
25
  subject { described_class.new(options) }
35
26
 
@@ -108,14 +99,28 @@ describe RainforestCli::Validator do
108
99
  it 'logs the errors' do
109
100
  expect(subject).to receive(:duplicate_rfml_ids_notification).with({'a-test' => 2}).and_call_original
110
101
 
111
- subject.validate
102
+ expect { subject.validate }.to raise_error(SystemExit)
103
+ end
104
+
105
+
106
+ context 'when invalid' do
107
+ before do
108
+ allow(subject).to receive(:invalid?).and_return(true)
109
+ end
110
+ it 'exits 1' do
111
+ begin
112
+ subject.validate
113
+ fail "validate did not exit with status 1"
114
+ rescue SystemExit => e
115
+ expect(e.status).to eq(1)
116
+ end
117
+ end
112
118
  end
113
119
  end
114
120
  end
115
121
 
116
122
  describe '#validate_with_exception!' do
117
123
  let(:tested_method) { :validate_with_exception! }
118
- let(:raises_error) { true }
119
124
 
120
125
  it_behaves_like 'it detects all the correct errors'
121
126
 
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.6.4
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-10 00:00:00.000000000 Z
12
+ date: 2016-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty