turnip 1.2.4 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45866c1a494dceaaf4f1b816e6348a27adfa5943
4
- data.tar.gz: d8a4f822013aea2863a8c9ca5ca6ef26beae1833
3
+ metadata.gz: 9ea3b0858fb792b2cf0156c7732d0f8129f019a7
4
+ data.tar.gz: 2438143523d14084f3f136353552efd8cc48f28e
5
5
  SHA512:
6
- metadata.gz: f74269b505fee7497407ea369678ca03413bd13282e29d8e6d3487596e69d5e5e623bfa981b0cbb4511ec1cf36e06f332da82bfb302c98d89aa2ba143d89e3b2
7
- data.tar.gz: 2499f65be4a50939b1ad584c658481d6a77899386774b035c7e1f1dce5fc0cda26f0867d7bcb7efc0b57e75c079ac9bea8f45dcf259cf862a7b5ead12da41d51
6
+ metadata.gz: a98490d1bfcbe5fc160866bc954764293aeaccebb93c03ca5987c2c0b6dd806359cfcbf15364bc26afac8fb2af0ce218133bffbe2190ce78fc24cf46637016b6
7
+ data.tar.gz: 8ff4e5e87f5223706d644b275d17610965b8f3734415552c3566cb4919fd9756f66489062a07733b9efcae8b6c88e7f4a16e3e3124da4182f9c9766d5423bdcd
@@ -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.0
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
- Turnip does not work on Ruby 1.8.X.
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:
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in turnip.gemspec
4
+ gemspec :path => '..'
5
+
6
+ gem 'rspec', '~> 3.1.0'
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in turnip.gemspec
4
+ gemspec :path => '..'
5
+
6
+ gem 'rspec', '~> 3.2.0'
@@ -110,11 +110,6 @@ module Turnip
110
110
  end
111
111
 
112
112
  class Step < Struct.new(:description, :extra_args, :line, :keyword)
113
- # 1.9.2 support hack
114
- def split(*args)
115
- self.to_s.split(*args)
116
- end
117
-
118
113
  def to_s
119
114
  "#{keyword}#{description}"
120
115
  end
@@ -6,7 +6,7 @@ module Turnip
6
6
  def called_from; step_definition.called_from; end
7
7
 
8
8
  def trace
9
- trace = %{ - "#{expression}" (#{called_from})}
9
+ %{ - "#{expression}" (#{called_from})}
10
10
  end
11
11
  end
12
12
 
@@ -1,3 +1,3 @@
1
1
  module Turnip
2
- VERSION = '1.2.4'
2
+ VERSION = '1.3.0'
3
3
  end
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.2.4
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: 2014-09-18 00:00:00.000000000 Z
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