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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c613eb80a564f1b10b6123c92df954d646bb1a1
4
- data.tar.gz: ea620f1c46a0c0bee233d1870d01be796abad6d6
3
+ metadata.gz: f19257391c98ab628c7d38bfec0c10d72f0a86f1
4
+ data.tar.gz: 9155eb43f95aca7d7d8f6c5ca84bfc716f31166a
5
5
  SHA512:
6
- metadata.gz: 988878afccf0d2f4b16d232b874e537ae1cb1f121a73f57f2ba0b269bdee753b22975baf629e49763d55fe6fb8c9c72210240fa7167eba8081c919ec52c0ec0a
7
- data.tar.gz: 0881c5e09f167002c3410cd1441803d5380f9ef4f3596fd39c527be32ccb94137cb87ad1c66228ae037e37c38e45b6f0a7855ee440748cda7451bde9443255aa
6
+ metadata.gz: 6b232fef5c7de26e9e9d1aad2e55f76fcee87cc09f79bf7f412a6fb29d37f222f02616f3563c0fa55771c3a61b564f374083c2aa43984ec7ef7b28d30f4b0035
7
+ data.tar.gz: 362f31272436c8e7c59838f826fa8c0c548d26370fb84bedf4c18a25f1f1ac4eb13ddefd5d0918a8c109b80da6a377e7bdd07564d581a584ae1faf85fd9bf8fb
@@ -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
- attr_reader :features
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).features.each do |feature|
68
- instance_eval <<-EOS, feature_file, feature.line
69
- context = ::RSpec.describe feature.name, feature.metadata_hash
70
- run_feature(context, feature, feature_file)
71
- EOS
72
- end
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
@@ -1,3 +1,3 @@
1
1
  module Turnip
2
- VERSION = '3.0.0-beta.3'
2
+ VERSION = '3.0.0-beta.4'
3
3
  end
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(:builder) { Turnip::Builder.build(feature_file) }
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.3
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-03 00:00:00.000000000 Z
11
+ date: 2016-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec