rainforest-cli 1.12.2 → 1.12.3

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: 1f59142b19a1c8a1acead8496c363abac25f1e26
4
- data.tar.gz: b67f1ccf9a7fc3dbc52762488b1e159048696643
3
+ metadata.gz: 0fee85958132e3b345c2515604efde99845b0496
4
+ data.tar.gz: 53901941d283610525d2f9232ad38363d6067675
5
5
  SHA512:
6
- metadata.gz: 38ad9bb4c69e36ffa54e3e31b597ae3c47adda976579248d504df2781a2c3663464b2d829946d75cc7b394586dfe60df985a668e5b3ccc9e66a8735444def5a7
7
- data.tar.gz: b68ddbb6e9ed0ac1e38a1bb954bed905213ff0835e22fca939e92cdca2b23632bc5f453886129eb5667d40a3d771653dbebb3dfd97524f06819bf079f5df56d5
6
+ metadata.gz: 3bb7f9524db4dc90980a4caaf54ba914368415c0412dd392d0eb945d1e2f43c9755f37ee37c8e068fe8c2a9a7cf016e10d681e8a831661504a42f5b58de86c44
7
+ data.tar.gz: c92ac9e76dbef3c2c70bbb09ec1270883fea04d3fb04a85ba3907a1d67e9e2e9aaf4d82cd4698a7919cc050cf4adc0bf92e5642a82d3a612170a6bb814eb3751
@@ -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(:line, :reason)
8
+ class Error < Struct.new(:location, :reason)
9
9
  def to_s
10
- "Line #{line}: #{reason}"
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[0] = Error.new(0, 'Missing RFML ID. Please start a line #! followed by a unique id.')
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module RainforestCli
3
- VERSION = '1.12.2'
3
+ VERSION = '1.12.3'
4
4
  end
@@ -12,8 +12,7 @@ describe RainforestCli::TestParser do
12
12
  end
13
13
 
14
14
  describe '#process' do
15
- let(:parsed_test) { subject.process }
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
@@ -2,4 +2,4 @@
2
2
  # title: No Question Test
3
3
  # start_uri: /
4
4
 
5
- This is an action without a question.
5
+ This is an action without a question?
@@ -2,4 +2,4 @@
2
2
  # start_uri: /
3
3
 
4
4
  This is an action.
5
- This is a question.
5
+ This is a question?
@@ -0,0 +1,6 @@
1
+ #! example_test
2
+ # start_uri: /
3
+ # This test has no title
4
+
5
+ This is a step action.
6
+ This is a question?
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.2
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: