turnip 1.3.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -12
- data/Gemfile +1 -1
- data/README.md +23 -3
- data/gemfiles/Gemfile-rspec-3.2.x +1 -1
- data/gemfiles/Gemfile-rspec-3.3.x +1 -1
- data/gemfiles/{Gemfile-rspec-2.14.x → Gemfile-rspec-3.4.x} +2 -2
- data/lib/turnip/capybara.rb +1 -2
- data/lib/turnip/rspec.rb +2 -15
- data/lib/turnip/version.rb +1 -1
- data/turnip.gemspec +1 -1
- metadata +5 -8
- data/gemfiles/Gemfile-rspec-2.99.x +0 -6
- data/gemfiles/Gemfile-rspec-3.0.x +0 -6
- data/gemfiles/Gemfile-rspec-3.1.x +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e13764190ae64991bef56ee17f874dd70b34a43c
|
4
|
+
data.tar.gz: 0194234d5c5560fcae6ed4ec1f98c4127e273473
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17511f911bcba948491f6cb3f8db9b64492c41c85d497f9f4dc442ba52895a86e34b581e01dfec77a55b2104ba34d8b42ada890af8a3a44066e7083daf10495c
|
7
|
+
data.tar.gz: 087b15c4ceddaab438898380f5c20f8cec905a253858275c697d3c634dc291c9adb9a8a85b66f1131b9e4859043894e0413bedc6a68eb5c7390ebf1f0fc2c873
|
data/.travis.yml
CHANGED
@@ -6,22 +6,23 @@ cache: bundler
|
|
6
6
|
branches:
|
7
7
|
only:
|
8
8
|
- master
|
9
|
+
- 2_0_0_rc1
|
9
10
|
|
10
11
|
matrix:
|
11
12
|
allow_failures:
|
12
13
|
- gemfile: Gemfile
|
14
|
+
- gemfile: gemfiles/Gemfile-rspec-3.2.x
|
13
15
|
- rvm: ruby-head
|
16
|
+
|
14
17
|
rvm:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
- 2.0.0
|
19
|
+
- 2.1
|
20
|
+
- 2.2
|
21
|
+
- ruby-head
|
22
|
+
- jruby-19mode
|
23
|
+
|
20
24
|
gemfile:
|
21
|
-
- Gemfile
|
22
|
-
- gemfiles/Gemfile-rspec-2.
|
23
|
-
- gemfiles/Gemfile-rspec-
|
24
|
-
- gemfiles/Gemfile-rspec-3.
|
25
|
-
- gemfiles/Gemfile-rspec-3.1.x
|
26
|
-
- gemfiles/Gemfile-rspec-3.2.x
|
27
|
-
- gemfiles/Gemfile-rspec-3.3.x
|
25
|
+
- Gemfile
|
26
|
+
- gemfiles/Gemfile-rspec-3.2.x
|
27
|
+
- gemfiles/Gemfile-rspec-3.3.x
|
28
|
+
- gemfiles/Gemfile-rspec-3.4.x
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -44,10 +44,30 @@ exist), and add the following line:
|
|
44
44
|
Pull requests are very welcome (and even better than bug reports)!
|
45
45
|
Please create a topic branch for every separate change you make.
|
46
46
|
|
47
|
-
## Compatibility and support
|
47
|
+
## Compatibility and support policy
|
48
|
+
|
49
|
+
### 1. Ruby
|
50
|
+
|
51
|
+
- Support Ruby 2.x
|
52
|
+
- Does not support Ruby 1.9.X
|
53
|
+
- Does not work on Ruby 1.8.X
|
54
|
+
|
55
|
+
### 2. RSpec
|
56
|
+
|
57
|
+
In accordance with the RSpec support policy https://github.com/jnicklas/turnip/issues/158#issuecomment-119049054
|
58
|
+
|
59
|
+
- Support RSpec 3.x **the latest or one version before**
|
60
|
+
- Does not support **two version before the latest or earlier**
|
61
|
+
- Does not work on **RSpec 2 or earlier**
|
62
|
+
|
63
|
+
Example `If the latest version is 3.4.x`:
|
64
|
+
|
65
|
+
- Support `3.4.x`
|
66
|
+
- Support `3.3.x`
|
67
|
+
- Does not support `3.2.x`
|
68
|
+
- Does not support `3.1.x`
|
69
|
+
- Does not support `2.x.y`
|
48
70
|
|
49
|
-
- Does not work on Ruby 1.8.X.
|
50
|
-
- Does not support Ruby 1.9.X.
|
51
71
|
|
52
72
|
## Usage
|
53
73
|
|
data/lib/turnip/capybara.rb
CHANGED
@@ -2,8 +2,7 @@ require 'capybara/rspec'
|
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
4
|
config.before do
|
5
|
-
current_example = RSpec.current_example
|
6
|
-
current_example ||= example
|
5
|
+
current_example = RSpec.current_example
|
7
6
|
|
8
7
|
if self.class.include?(Capybara::DSL) and current_example.metadata[:turnip]
|
9
8
|
Capybara.current_driver = Capybara.javascript_driver if current_example.metadata.has_key?(:javascript)
|
data/lib/turnip/rspec.rb
CHANGED
@@ -45,8 +45,7 @@ module Turnip
|
|
45
45
|
step(step)
|
46
46
|
EOS
|
47
47
|
rescue Turnip::Pending => e
|
48
|
-
|
49
|
-
example = Turnip::RSpec.fetch_current_example(self)
|
48
|
+
example = ::RSpec.current_example
|
50
49
|
example.metadata[:line_number] = step.line
|
51
50
|
example.metadata[:location] = "#{example.metadata[:file_path]}:#{step.line}"
|
52
51
|
|
@@ -55,11 +54,7 @@ module Turnip
|
|
55
54
|
raise
|
56
55
|
end
|
57
56
|
|
58
|
-
|
59
|
-
skip("No such step: '#{e}'")
|
60
|
-
else
|
61
|
-
pending("No such step: '#{e}'")
|
62
|
-
end
|
57
|
+
skip("No such step: '#{e}'")
|
63
58
|
rescue StandardError, ::RSpec::Expectations::ExpectationNotMetError => e
|
64
59
|
e.backtrace.push "#{feature_file}:#{step.line}:in `#{step.description}'"
|
65
60
|
raise e
|
@@ -68,14 +63,6 @@ module Turnip
|
|
68
63
|
end
|
69
64
|
|
70
65
|
class << self
|
71
|
-
def fetch_current_example(context)
|
72
|
-
if ::RSpec.respond_to?(:current_example)
|
73
|
-
::RSpec.current_example
|
74
|
-
else
|
75
|
-
context.example
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
66
|
def run(feature_file)
|
80
67
|
Turnip::Builder.build(feature_file).features.each do |feature|
|
81
68
|
instance_eval <<-EOS, feature_file, feature.line
|
data/lib/turnip/version.rb
CHANGED
data/turnip.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_runtime_dependency "rspec", [">=
|
21
|
+
s.add_runtime_dependency "rspec", [">=3.0", "<4.0"]
|
22
22
|
s.add_runtime_dependency "gherkin", ">= 2.5"
|
23
23
|
s.add_development_dependency "rake"
|
24
24
|
s.add_development_dependency "pry"
|
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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '3.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '4.0'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: '3.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '4.0'
|
@@ -113,12 +113,9 @@ files:
|
|
113
113
|
- examples/tags.feature
|
114
114
|
- examples/with_backticks.feature
|
115
115
|
- examples/with_comments.feature
|
116
|
-
- gemfiles/Gemfile-rspec-2.14.x
|
117
|
-
- gemfiles/Gemfile-rspec-2.99.x
|
118
|
-
- gemfiles/Gemfile-rspec-3.0.x
|
119
|
-
- gemfiles/Gemfile-rspec-3.1.x
|
120
116
|
- gemfiles/Gemfile-rspec-3.2.x
|
121
117
|
- gemfiles/Gemfile-rspec-3.3.x
|
118
|
+
- gemfiles/Gemfile-rspec-3.4.x
|
122
119
|
- lib/turnip.rb
|
123
120
|
- lib/turnip/builder.rb
|
124
121
|
- lib/turnip/capybara.rb
|