cucumber-core 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/cucumber/core/ast.rb +1 -0
- data/lib/cucumber/core/ast/data_table.rb +1 -5
- data/lib/cucumber/core/ast/doc_string.rb +0 -4
- data/lib/cucumber/core/ast/empty_multiline_argument.rb +24 -0
- data/lib/cucumber/core/ast/location.rb +4 -2
- data/lib/cucumber/core/ast/multiline_argument.rb +2 -1
- data/lib/cucumber/core/ast/outline_step.rb +1 -3
- data/lib/cucumber/core/ast/step.rb +2 -3
- data/lib/cucumber/core/version.rb +1 -1
- data/spec/cucumber/core/ast/outline_step_spec.rb +2 -1
- data/spec/cucumber/core/ast/step_spec.rb +3 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c30d51fa9f12c4fb7b91a14006a9a308b652cf0
|
4
|
+
data.tar.gz: cb60c3d4d610070a1e8344388900dfb553a10de4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e34a846062bf14159235cbe27829195e940fc57b465f69b750835fc5b2ffdd41e930e287be8ea2742c300c0ed9ecc093dcb5eca173b1b5da60e1eebd96d21494
|
7
|
+
data.tar.gz: fd76c152cc8183f86482f41262ef858b4efb3df34b946a179c2de3e157a7bca52020fa5adff880c975fb775356f06203a5204ee410e6e58db68fa487f81984b8
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
cucumber-
|
1
|
+
cucumber-core
|
2
2
|
==================
|
3
3
|
|
4
4
|
[![Build Status](https://secure.travis-ci.org/cucumber/cucumber-ruby-core.png)](http://travis-ci.org/cucumber/cucumber-ruby-core)
|
5
|
-
[![Code
|
6
|
-
Climate](https://codeclimate.com/github/cucumber/cucumber-ruby-core.png)](https://codeclimate.com/github/cucumber/cucumber-ruby-core)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby-core.png)](https://codeclimate.com/github/cucumber/cucumber-ruby-core)
|
7
6
|
[![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby-core/badge.png?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby-core?branch=master)
|
7
|
+
[![Dependency Status](https://gemnasium.com/cucumber/cucumber-ruby-core.png)](https://gemnasium.com/cucumber/cucumber-ruby-core)
|
8
8
|
|
9
|
-
Core library for the Ruby flavour of Cucumber
|
9
|
+
Core library for the Ruby flavour of Cucumber.
|
data/lib/cucumber/core/ast.rb
CHANGED
@@ -2,6 +2,7 @@ require 'cucumber/core/ast/comment'
|
|
2
2
|
require 'cucumber/core/ast/tag'
|
3
3
|
require 'cucumber/core/ast/feature'
|
4
4
|
require 'cucumber/core/ast/empty_background'
|
5
|
+
require 'cucumber/core/ast/empty_multiline_argument'
|
5
6
|
require 'cucumber/core/ast/background'
|
6
7
|
require 'cucumber/core/ast/scenario'
|
7
8
|
require 'cucumber/core/ast/step'
|
@@ -51,10 +51,6 @@ module Cucumber
|
|
51
51
|
|
52
52
|
attr_accessor :file
|
53
53
|
|
54
|
-
def self.default_arg_name #:nodoc:
|
55
|
-
"table"
|
56
|
-
end
|
57
|
-
|
58
54
|
def self.parse(text, uri, location)
|
59
55
|
builder = Builder.new
|
60
56
|
lexer = ::Gherkin::Lexer::I18nLexer.new(builder)
|
@@ -257,7 +253,7 @@ module Cucumber
|
|
257
253
|
end
|
258
254
|
|
259
255
|
def description_for_visitors
|
260
|
-
:
|
256
|
+
:data_table
|
261
257
|
end
|
262
258
|
|
263
259
|
# Represents a row of cells or columns of cells
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Cucumber
|
2
|
+
module Core
|
3
|
+
module Ast
|
4
|
+
class EmptyMultilineArgument
|
5
|
+
def describe_to(*)
|
6
|
+
self
|
7
|
+
end
|
8
|
+
|
9
|
+
def map(&block)
|
10
|
+
self
|
11
|
+
end
|
12
|
+
|
13
|
+
def match_locations?(*args)
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_sexp
|
18
|
+
[]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -118,8 +118,7 @@ module Cucumber
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def attributes
|
121
|
-
|
122
|
-
[tags, comments, multiline_arg].flatten.compact
|
121
|
+
[tags, comments, multiline_arg].flatten
|
123
122
|
end
|
124
123
|
|
125
124
|
def tags
|
@@ -128,10 +127,13 @@ module Cucumber
|
|
128
127
|
end
|
129
128
|
|
130
129
|
def comments
|
130
|
+
# will be overriden by nodes that actually have comments
|
131
131
|
[]
|
132
132
|
end
|
133
133
|
|
134
134
|
def multiline_arg
|
135
|
+
# will be overriden by nodes that actually have a multiline_argument
|
136
|
+
EmptyMultilineArgument.new
|
135
137
|
end
|
136
138
|
|
137
139
|
end
|
@@ -8,8 +8,9 @@ module Cucumber
|
|
8
8
|
class << self
|
9
9
|
include Gherkin::Rubify
|
10
10
|
|
11
|
+
# TODO: move this up to the front-end
|
11
12
|
def from(argument, parent_location)
|
12
|
-
return unless argument
|
13
|
+
return EmptyMultilineArgument.new unless argument
|
13
14
|
return argument if argument.respond_to?(:to_step_definition_arg)
|
14
15
|
|
15
16
|
argument = rubify(argument)
|
@@ -12,7 +12,7 @@ module Cucumber
|
|
12
12
|
|
13
13
|
attr_reader :language, :location, :keyword, :name, :multiline_arg
|
14
14
|
|
15
|
-
def initialize(language, location, keyword, name, multiline_arg
|
15
|
+
def initialize(language, location, keyword, name, multiline_arg)
|
16
16
|
@language, @location, @keyword, @name, @multiline_arg = language, location, keyword, name, multiline_arg
|
17
17
|
@language || raise("Language is required!")
|
18
18
|
end
|
@@ -32,10 +32,8 @@ module Cucumber
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def children
|
35
|
-
# TODO use a null object
|
36
35
|
# TODO remove duplication with Step
|
37
36
|
# TODO spec
|
38
|
-
return [] unless @multiline_arg
|
39
37
|
[@multiline_arg]
|
40
38
|
end
|
41
39
|
|
@@ -10,7 +10,7 @@ module Cucumber
|
|
10
10
|
|
11
11
|
attr_reader :keyword, :name, :language, :exception, :multiline_arg
|
12
12
|
|
13
|
-
def initialize(language, location, keyword, name, multiline_arg
|
13
|
+
def initialize(language, location, keyword, name, multiline_arg)
|
14
14
|
@location, @keyword, @name, @multiline_arg = location, keyword, name, multiline_arg
|
15
15
|
end
|
16
16
|
|
@@ -19,13 +19,12 @@ module Cucumber
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def to_sexp
|
22
|
-
[:step, line, keyword, name,
|
22
|
+
[:step, line, keyword, name, @multiline_arg.to_sexp]
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def children
|
28
|
-
return [] unless @multiline_arg # TODO: use a null object
|
29
28
|
[@multiline_arg]
|
30
29
|
end
|
31
30
|
|
@@ -7,11 +7,12 @@ module Cucumber
|
|
7
7
|
module Core
|
8
8
|
module Ast
|
9
9
|
describe OutlineStep do
|
10
|
-
let(:outline_step) { OutlineStep.new(language, location, keyword, name) }
|
10
|
+
let(:outline_step) { OutlineStep.new(language, location, keyword, name, multiline_arg) }
|
11
11
|
let(:language) { double }
|
12
12
|
let(:location) { double }
|
13
13
|
let(:keyword) { double }
|
14
14
|
let(:name) { 'anything' }
|
15
|
+
let(:multiline_arg) { EmptyMultilineArgument.new }
|
15
16
|
|
16
17
|
describe 'location' do
|
17
18
|
it "has a location" do
|
@@ -5,8 +5,9 @@ module Cucumber
|
|
5
5
|
module Ast
|
6
6
|
describe Step do
|
7
7
|
let(:step) do
|
8
|
-
language, location, keyword, name = double
|
9
|
-
|
8
|
+
language, location, keyword, name = *double
|
9
|
+
multiline_arg = EmptyMultilineArgument.new
|
10
|
+
Step.new(language, location, keyword, name, multiline_arg)
|
10
11
|
end
|
11
12
|
|
12
13
|
describe "describing itself" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-02-
|
15
|
+
date: 2014-02-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: gherkin
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- lib/cucumber/core/ast/describes_itself.rb
|
122
122
|
- lib/cucumber/core/ast/doc_string.rb
|
123
123
|
- lib/cucumber/core/ast/empty_background.rb
|
124
|
+
- lib/cucumber/core/ast/empty_multiline_argument.rb
|
124
125
|
- lib/cucumber/core/ast/examples_table.rb
|
125
126
|
- lib/cucumber/core/ast/feature.rb
|
126
127
|
- lib/cucumber/core/ast/location.rb
|
@@ -192,10 +193,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
193
|
version: '0'
|
193
194
|
requirements: []
|
194
195
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
196
|
+
rubygems_version: 2.0.14
|
196
197
|
signing_key:
|
197
198
|
specification_version: 4
|
198
|
-
summary: cucumber-core-0.
|
199
|
+
summary: cucumber-core-0.2.0
|
199
200
|
test_files:
|
200
201
|
- spec/capture_warnings.rb
|
201
202
|
- spec/coverage.rb
|
@@ -218,4 +219,3 @@ test_files:
|
|
218
219
|
- spec/cucumber/core/test/timer_spec.rb
|
219
220
|
- spec/cucumber/core_spec.rb
|
220
221
|
- spec/cucumber/initializer_spec.rb
|
221
|
-
has_rdoc:
|