turnip 1.2.4 → 1.3.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 +15 -2
- data/README.md +41 -2
- data/gemfiles/Gemfile-rspec-3.1.x +6 -0
- data/gemfiles/Gemfile-rspec-3.2.x +6 -0
- data/lib/turnip/builder.rb +0 -5
- data/lib/turnip/step_definition.rb +1 -1
- data/lib/turnip/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ea3b0858fb792b2cf0156c7732d0f8129f019a7
|
4
|
+
data.tar.gz: 2438143523d14084f3f136353552efd8cc48f28e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a98490d1bfcbe5fc160866bc954764293aeaccebb93c03ca5987c2c0b6dd806359cfcbf15364bc26afac8fb2af0ce218133bffbe2190ce78fc24cf46637016b6
|
7
|
+
data.tar.gz: 8ff4e5e87f5223706d644b275d17610965b8f3734415552c3566cb4919fd9756f66489062a07733b9efcae8b6c88e7f4a16e3e3124da4182f9c9766d5423bdcd
|
data/.travis.yml
CHANGED
@@ -1,9 +1,22 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
sudo: false
|
4
|
+
cache: bundler
|
5
|
+
|
6
|
+
matrix:
|
7
|
+
allow_failures:
|
8
|
+
- gemfile: Gemfile
|
9
|
+
- rvm: ruby-head
|
1
10
|
rvm:
|
2
|
-
- 1.9.3
|
3
11
|
- 2.0.0
|
4
|
-
- 2.1
|
12
|
+
- 2.1
|
13
|
+
- 2.2
|
14
|
+
- ruby-head
|
5
15
|
- jruby-19mode
|
6
16
|
gemfile:
|
17
|
+
- Gemfile
|
7
18
|
- gemfiles/Gemfile-rspec-2.14.x
|
8
19
|
- gemfiles/Gemfile-rspec-2.99.x
|
9
20
|
- gemfiles/Gemfile-rspec-3.0.x
|
21
|
+
- gemfiles/Gemfile-rspec-3.1.x
|
22
|
+
- gemfiles/Gemfile-rspec-3.2.x
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Turnip
|
2
2
|
|
3
|
+
[![Join the chat at https://gitter.im/jnicklas/turnip](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jnicklas/turnip?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
|
+
|
3
5
|
[![Build Status](https://secure.travis-ci.org/jnicklas/turnip.png)](http://travis-ci.org/jnicklas/turnip)
|
4
6
|
[![Code Climate](https://codeclimate.com/github/jnicklas/turnip.png)](https://codeclimate.com/github/jnicklas/turnip)
|
5
7
|
|
@@ -42,9 +44,10 @@ exist), and add the following line:
|
|
42
44
|
Pull requests are very welcome (and even better than bug reports)!
|
43
45
|
Please create a topic branch for every separate change you make.
|
44
46
|
|
45
|
-
## Compatibility
|
47
|
+
## Compatibility and support
|
46
48
|
|
47
|
-
|
49
|
+
- Does not work on Ruby 1.8.X.
|
50
|
+
- Does not support Ruby 1.9.X.
|
48
51
|
|
49
52
|
## Usage
|
50
53
|
|
@@ -333,6 +336,42 @@ end
|
|
333
336
|
These regular expressions must not use anchors, e.g. `^` or `$`. They may not
|
334
337
|
contain named capture groups, e.g. `(?<color>blue|green)`.
|
335
338
|
|
339
|
+
Note that custom placeholders can capture several words separated by spaces and without surrounding quotes, e.g.:
|
340
|
+
|
341
|
+
```ruby
|
342
|
+
|
343
|
+
step 'there is :monster in the loft' do |monster|
|
344
|
+
# call 'Given there is green furry monster in the loft',
|
345
|
+
# :monster will capture 'green furry moster'
|
346
|
+
end
|
347
|
+
```
|
348
|
+
|
349
|
+
E.g. Common `should` / `should not` steps:
|
350
|
+
|
351
|
+
```ruby
|
352
|
+
step 'I :whether_to see :text' do |positive, text|
|
353
|
+
expectation = positive ? :to : :not_to
|
354
|
+
expect(page.body).send expectation, eq(text)
|
355
|
+
end
|
356
|
+
|
357
|
+
placeholder :whether_to do
|
358
|
+
match /should not/ do
|
359
|
+
false
|
360
|
+
end
|
361
|
+
|
362
|
+
match /should/ do
|
363
|
+
true
|
364
|
+
end
|
365
|
+
end
|
366
|
+
```
|
367
|
+
|
368
|
+
Then, it is possible to call the following steps:
|
369
|
+
|
370
|
+
```feature
|
371
|
+
Then I should see 'Danger! Monsters ahead!'
|
372
|
+
And I should not see 'Game over!'
|
373
|
+
```
|
374
|
+
|
336
375
|
## Table Steps
|
337
376
|
|
338
377
|
Turnip also supports steps that take a table as a parameter similar to Cucumber:
|
data/lib/turnip/builder.rb
CHANGED
data/lib/turnip/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -116,6 +116,8 @@ files:
|
|
116
116
|
- gemfiles/Gemfile-rspec-2.14.x
|
117
117
|
- gemfiles/Gemfile-rspec-2.99.x
|
118
118
|
- gemfiles/Gemfile-rspec-3.0.x
|
119
|
+
- gemfiles/Gemfile-rspec-3.1.x
|
120
|
+
- gemfiles/Gemfile-rspec-3.2.x
|
119
121
|
- lib/turnip.rb
|
120
122
|
- lib/turnip/builder.rb
|
121
123
|
- lib/turnip/capybara.rb
|