rainforest-cli 1.12.2 → 1.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rainforest_cli/test_parser.rb +13 -3
- data/lib/rainforest_cli/version.rb +1 -1
- data/spec/rainforest_cli/test_parser_spec.rb +12 -2
- data/spec/validation-examples/parse_errors/no_question.rfml +1 -1
- data/spec/validation-examples/parse_errors/no_rfml_id.rfml +1 -1
- data/spec/validation-examples/parse_errors/no_title.rfml +6 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fee85958132e3b345c2515604efde99845b0496
|
4
|
+
data.tar.gz: 53901941d283610525d2f9232ad38363d6067675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bb7f9524db4dc90980a4caaf54ba914368415c0412dd392d0eb945d1e2f43c9755f37ee37c8e068fe8c2a9a7cf016e10d681e8a831661504a42f5b58de86c44
|
7
|
+
data.tar.gz: c92ac9e76dbef3c2c70bbb09ec1270883fea04d3fb04a85ba3907a1d67e9e2e9aaf4d82cd4698a7919cc050cf4adc0bf92e5642a82d3a612170a6bb814eb3751
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Rainforest CLI Changelog
|
2
2
|
|
3
|
+
## 1.12.3 - 24th February 2017
|
4
|
+
- Validate RFML tests for a title.
|
5
|
+
(beb439a3d2c12f618d6b4b00a3a08f1e37bbbe7a, @epaulet)
|
6
|
+
|
3
7
|
## 1.12.2 - 23rd February 2017
|
4
8
|
- Default `start_uri` attribute to "/" if omitted from RFML test.
|
5
9
|
(ec6049407ec635b7f7bc4f8da516ccddad2b78b3, @epaulet)
|
@@ -5,9 +5,12 @@ module RainforestCli::TestParser
|
|
5
5
|
require 'rainforest_cli/test_parser/step'
|
6
6
|
require 'rainforest_cli/test_parser/embedded_test'
|
7
7
|
|
8
|
-
class Error < Struct.new(:
|
8
|
+
class Error < Struct.new(:location, :reason)
|
9
9
|
def to_s
|
10
|
-
|
10
|
+
case location
|
11
|
+
when Integer then "Line #{location}: #{reason}"
|
12
|
+
when Symbol, String then "Field #{location}: #{reason}"
|
13
|
+
end
|
11
14
|
end
|
12
15
|
end
|
13
16
|
|
@@ -98,7 +101,14 @@ module RainforestCli::TestParser
|
|
98
101
|
end
|
99
102
|
|
100
103
|
if @test.rfml_id == nil
|
101
|
-
@test.errors[
|
104
|
+
@test.errors[:rfml_id] = Error.new(:rfml_id, 'Missing RFML ID. Please start a line #! followed by a unique id.')
|
105
|
+
end
|
106
|
+
|
107
|
+
if @test.title.nil? || @test.title.empty?
|
108
|
+
@test.errors[:title] = Error.new(
|
109
|
+
:title,
|
110
|
+
'Missing Title for test. Please start a line with "# title: " and specify your test title.',
|
111
|
+
)
|
102
112
|
end
|
103
113
|
|
104
114
|
return @test
|
@@ -12,8 +12,7 @@ describe RainforestCli::TestParser do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#process' do
|
15
|
-
let(:parsed_test) {
|
16
|
-
let(:parsed_step) { parsed_test.steps.first }
|
15
|
+
let(:parsed_test) { described_class.new(file_name).process }
|
17
16
|
|
18
17
|
describe 'parsing comments' do
|
19
18
|
it 'properly identifies comments' do
|
@@ -28,9 +27,20 @@ describe RainforestCli::TestParser do
|
|
28
27
|
end
|
29
28
|
|
30
29
|
it 'properly parses step metadata' do
|
30
|
+
parsed_step = parsed_test.steps.first
|
31
31
|
expect(parsed_step.redirect).to eq('false')
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
describe 'errors' do
|
36
|
+
context 'no title' do
|
37
|
+
let(:file_name) { './spec/validation-examples/parse_errors/no_title.rfml' }
|
38
|
+
|
39
|
+
specify do
|
40
|
+
expect(parsed_test.errors[:title]).to_not be_nil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
34
44
|
end
|
35
45
|
end
|
36
46
|
end
|
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.12.
|
4
|
+
version: 1.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Smith
|
@@ -274,6 +274,7 @@ files:
|
|
274
274
|
- spec/validation-examples/parse_errors/no_question.rfml
|
275
275
|
- spec/validation-examples/parse_errors/no_question_mark.rfml
|
276
276
|
- spec/validation-examples/parse_errors/no_rfml_id.rfml
|
277
|
+
- spec/validation-examples/parse_errors/no_title.rfml
|
277
278
|
homepage: https://www.rainforestqa.com/
|
278
279
|
licenses:
|
279
280
|
- MIT
|
@@ -345,4 +346,5 @@ test_files:
|
|
345
346
|
- spec/validation-examples/parse_errors/no_question.rfml
|
346
347
|
- spec/validation-examples/parse_errors/no_question_mark.rfml
|
347
348
|
- spec/validation-examples/parse_errors/no_rfml_id.rfml
|
349
|
+
- spec/validation-examples/parse_errors/no_title.rfml
|
348
350
|
has_rdoc:
|