rutabaga 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.turnip2 +5 -0
- data/README.md +1 -1
- data/lib/rutabaga/feature.rb +2 -1
- data/lib/rutabaga/util.rb +10 -1
- data/lib/rutabaga/version.rb +1 -1
- data/rutabaga.gemspec +1 -1
- data/spec/rutabaga/util_spec.rb +4 -4
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 131a900096212a9e96f19e0d51909e7ba1aea969
|
4
|
+
data.tar.gz: 8183023b1311fe93540e0986d69007a1a29853d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69dafa7ad275b5efe944da37db51eae4d4650d1f4b4f03aef59577df8dd2d51a4226818bf3d2592dd6b6563a1f40c821c5faee1fc6c1f4783ce645bc598b67df
|
7
|
+
data.tar.gz: c560410a9e9667c37a71f8e3acc7710d4d468ddbdaea3734f899b13b5b62bbdaceb71168bcbce7124192f1d7fc85670f007f502faab5ea3466bd73d90e8b2e42
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.turnip2
ADDED
data/README.md
CHANGED
@@ -173,7 +173,7 @@ The goal is to test just the business rule in Rutabaga, and not the login, the h
|
|
173
173
|
|
174
174
|
Use `gem-release` to maintain versions https://github.com/svenfuchs/gem-release.
|
175
175
|
|
176
|
-
To update the
|
176
|
+
To update the patch version (e.g. 0.0.1 to 0.0.2), after merging the PR to `master` run:
|
177
177
|
|
178
178
|
```
|
179
179
|
gem bump --tag --release
|
data/lib/rutabaga/feature.rb
CHANGED
@@ -30,7 +30,8 @@ module Rutabaga
|
|
30
30
|
|
31
31
|
# Adapted from jnicklas/turnip v2.0.0
|
32
32
|
def run(feature_file, example_group_class)
|
33
|
-
|
33
|
+
features = Util.build_features(feature_file)
|
34
|
+
features.each do |feature|
|
34
35
|
describe = example_group_class.describe feature.name, feature.metadata_hash
|
35
36
|
run_feature(describe, feature, feature_file, example_group_class)
|
36
37
|
end
|
data/lib/rutabaga/util.rb
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
# Monkey patch for Turnip to not have to copy loads of code
|
4
4
|
module Turnip::RSpec
|
5
5
|
def self.rutabaga_run(feature_file, example_group_class)
|
6
|
-
|
6
|
+
features = Rutabaga::Util.build_features(feature_file)
|
7
|
+
features.each do |feature|
|
7
8
|
instance_eval <<-EOS, feature_file, feature.line
|
8
9
|
describe = example_group_class.describe feature.name, feature.metadata_hash.reject { |key, _| key == :type }
|
9
10
|
run_feature(describe, feature, feature_file)
|
@@ -43,6 +44,14 @@ module Rutabaga
|
|
43
44
|
raise unless e.message.include?(filename)
|
44
45
|
end
|
45
46
|
|
47
|
+
def build_features(feature_file)
|
48
|
+
if Gem::Version.new(Turnip::VERSION) >= Gem::Version.new('3.0.0')
|
49
|
+
[Turnip::Builder.build(feature_file)]
|
50
|
+
else
|
51
|
+
Turnip::Builder.build(feature_file).features
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
46
55
|
private
|
47
56
|
|
48
57
|
def extract_directory
|
data/lib/rutabaga/version.rb
CHANGED
data/rutabaga.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = Rutabaga::VERSION
|
17
17
|
gem.license = 'MIT'
|
18
18
|
|
19
|
-
gem.add_runtime_dependency 'turnip', ['
|
19
|
+
gem.add_runtime_dependency 'turnip', ['>= 2.1.1', '< 4.0']
|
20
20
|
gem.add_runtime_dependency 'rspec', ['~> 3.0']
|
21
21
|
|
22
22
|
gem.add_development_dependency 'capybara'
|
data/spec/rutabaga/util_spec.rb
CHANGED
@@ -104,26 +104,26 @@ describe Rutabaga::Util do
|
|
104
104
|
it "has a nil description" do
|
105
105
|
@description = nil
|
106
106
|
|
107
|
-
expect{subject}.to raise_error(/Feature file not found\. Tried:
|
107
|
+
expect{subject}.to raise_error(/Feature file not found\. Tried: .*\/spec\/rutabaga\/util\.feature/)
|
108
108
|
end
|
109
109
|
|
110
110
|
it "has a sentance description" do
|
111
111
|
@description = "my life as a dog"
|
112
112
|
|
113
|
-
expect{subject}.to raise_error(/Feature file not found\. Tried:
|
113
|
+
expect{subject}.to raise_error(/Feature file not found\. Tried: .*\/spec\/rutabaga\/util\.feature/)
|
114
114
|
end
|
115
115
|
|
116
116
|
it "has a filename description but the file doesn't exist" do
|
117
117
|
@description = "example.feature"
|
118
118
|
|
119
|
-
expect{subject}.to raise_error(/Feature file not found\. Tried: example\.feature,
|
119
|
+
expect{subject}.to raise_error(/Feature file not found\. Tried: example\.feature, .*example\.feature/)
|
120
120
|
end
|
121
121
|
|
122
122
|
it "raises an error if the filename does not end in feature" do
|
123
123
|
@description = "example.other"
|
124
124
|
allow(File).to receive(:exists?).with(@description).and_return(true)
|
125
125
|
|
126
|
-
expect{subject}.to raise_error(/Feature file not found\. Tried:
|
126
|
+
expect{subject}.to raise_error(/Feature file not found\. Tried: .*\/spec\/rutabaga\/util\.feature/)
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutabaga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Oberhuber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: turnip
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.1'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 2.1.1
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '4.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '2.1'
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 2.1.1
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '4.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- ".travis.yml"
|
84
84
|
- CHANGELOG.md
|
85
85
|
- Gemfile
|
86
|
+
- Gemfile.turnip2
|
86
87
|
- LICENSE
|
87
88
|
- README.md
|
88
89
|
- Rakefile
|
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
134
|
version: '0'
|
134
135
|
requirements: []
|
135
136
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.6.8
|
137
138
|
signing_key:
|
138
139
|
specification_version: 4
|
139
140
|
summary: Calling Turnip feature files from RSpec, which allows encapsulating a feature
|