turnip 3.0.0.pre.beta.3 → 3.0.0.pre.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/turnip/builder.rb +5 -20
- data/lib/turnip/rspec.rb +6 -6
- data/lib/turnip/version.rb +1 -1
- data/spec/builder_spec.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f19257391c98ab628c7d38bfec0c10d72f0a86f1
|
4
|
+
data.tar.gz: 9155eb43f95aca7d7d8f6c5ca84bfc716f31166a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b232fef5c7de26e9e9d1aad2e55f76fcee87cc09f79bf7f412a6fb29d37f222f02616f3563c0fa55771c3a61b564f374083c2aa43984ec7ef7b28d30f4b0035
|
7
|
+
data.tar.gz: 362f31272436c8e7c59838f826fa8c0c548d26370fb84bedf4c18a25f1f1ac4eb13ddefd5d0918a8c109b80da6a377e7bdd07564d581a584ae1faf85fd9bf8fb
|
data/lib/turnip/builder.rb
CHANGED
@@ -3,27 +3,12 @@ require 'turnip/node/feature'
|
|
3
3
|
|
4
4
|
module Turnip
|
5
5
|
class Builder
|
6
|
+
def self.build(feature_file)
|
7
|
+
parser = Gherkin::Parser.new
|
8
|
+
result = parser.parse(File.read(feature_file))
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
class << self
|
10
|
-
def build(feature_file)
|
11
|
-
Turnip::Builder.new.tap do |builder|
|
12
|
-
parser = Gherkin::Parser.new
|
13
|
-
result = parser.parse(File.read(feature_file))
|
14
|
-
builder.build(result)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def initialize
|
20
|
-
@features = []
|
21
|
-
end
|
22
|
-
|
23
|
-
def build(attributes)
|
24
|
-
return unless attributes[:feature]
|
25
|
-
|
26
|
-
@features << Node::Feature.new(attributes[:feature])
|
10
|
+
return nil unless result[:feature]
|
11
|
+
Node::Feature.new(result[:feature])
|
27
12
|
end
|
28
13
|
end
|
29
14
|
end
|
data/lib/turnip/rspec.rb
CHANGED
@@ -64,12 +64,12 @@ module Turnip
|
|
64
64
|
|
65
65
|
class << self
|
66
66
|
def run(feature_file)
|
67
|
-
Turnip::Builder.build(feature_file)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
67
|
+
feature = Turnip::Builder.build(feature_file)
|
68
|
+
|
69
|
+
instance_eval <<-EOS, feature_file, feature.line
|
70
|
+
context = ::RSpec.describe feature.name, feature.metadata_hash
|
71
|
+
run_feature(context, feature, feature_file)
|
72
|
+
EOS
|
73
73
|
end
|
74
74
|
|
75
75
|
private
|
data/lib/turnip/version.rb
CHANGED
data/spec/builder_spec.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Turnip::Builder do
|
4
|
-
let(:
|
5
|
-
let(:feature) { builder.features.first }
|
4
|
+
let(:feature) { Turnip::Builder.build(feature_file) }
|
6
5
|
|
7
6
|
context 'simple scenarios' do
|
8
7
|
let(:feature_file) { File.expand_path('../examples/simple_feature.feature', File.dirname(__FILE__)) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.pre.beta.
|
4
|
+
version: 3.0.0.pre.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|