Permalink
Browse files

Fix deprecations

- Handle Cucumber::Ast::DocString
- Include Capybara::DSL instead of Capybara
- Ignore .rvm directory for coverage
- Add links to README and tidy up
  • Loading branch information...
1 parent 83dd0b0 commit 0e045df280584eeb0c82dfd4bb3d9e8f62a65432 @wapcaplet committed Mar 13, 2012
Showing with 17 additions and 14 deletions.
  1. +12 −11 README.md
  2. +1 −1 Rakefile
  3. +1 −1 examples/sinatra_app/features/support/env.rb
  4. +2 −0 lib/kelp/helper.rb
  5. +1 −1 spec/spec_helper.rb
View
@@ -26,17 +26,20 @@ Motivation
Kelp was developed as an attempt to get away from the bad habit of nesting
steps inside one another. While Cucumber does allow this behavior, it is
frowned upon by much of the Cucumber community. It was also partly motivated by
-a desire to move away from imperative steps, toward a more declarative style.
+a desire to move away from imperative steps, toward a
+[more declarative style](http://automation-excellence.com/blog/declare-or-impair).
Some of Capybara's methods were perceived as being too low-level, especially
when it comes to filling in or verifying several different fields in a form, or
checking the presence or absence of multiple strings or regular expressions.
-As of version 1.1.0, cucumber-rails no longer provides a generator for
-`web_steps.rb`; since Kelp does provide such a generator, it may serve the
-niche market of cucumber-rails users who preferred to use the imperative step
-definitions that it provided. Kelp's intent is not to encourage this behavior;
-nearly all of the imperative steps it provides are one-liners, which in many
-cases are more succinct and readable than the step definition that wraps them.
+As of version 1.1.0, cucumber-rails
+[no longer provides](http://aslakhellesoy.com/post/11055981222/the-training-wheels-came-off)
+a generator for `web_steps.rb`; since Kelp does provide such a generator, it
+may serve the niche market of cucumber-rails users who preferred to use the
+imperative step definitions that it provided. Kelp's intent is not to encourage
+this behavior; nearly all of the imperative steps it provides are one-liners,
+which in many cases are more succinct and readable than the step definition
+that wraps them.
It is this developer's opinion that imperative `web_steps.rb`-style steps can
be the easiest route to a working Cucumber scenario, but that they can also
@@ -86,10 +89,8 @@ Or even this:
]
end
-Many of the provided methods are similar to their counterparts in the
-Cucumber-Rails generated step definitions. Following links, filling in fields,
-and pressing buttons can all be easily done with Ruby code instead of nested
-steps. Thus this:
+Following links, filling in fields, and pressing buttons can all be easily done
+with Ruby code instead of nested steps. Thus this:
When %{I follow "Login"}
And %{I fill in "Username" with "skroob"}
View
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = ['--color', '--format doc']
t.rcov = true
t.rcov_opts = [
- '--exclude /.gem/,/gems/,spec,features,examples',
+ '--exclude /.rvm/,/.gem/,/gems/,spec,features,examples',
'--include lib/**/*.rb',
'--aggregate coverage.data',
]
@@ -11,7 +11,7 @@
Capybara.app = TestApp
class TestAppWorld
- include Capybara
+ include Capybara::DSL
end
World do
View
@@ -7,6 +7,8 @@ module Helper
def listify(items)
if items.class == Cucumber::Ast::Table
strings = items.raw.flatten
+ elsif items.class == Cucumber::Ast::DocString
+ strings = items.to_s.split(/[\r\n]+/)
else
strings = items.split(/[\r\n]+/)
end
View
@@ -6,7 +6,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'examples', 'sinatra_app', 'app'))
RSpec.configure do |config|
- config.include Capybara
+ config.include Capybara::DSL
config.include Kelp::Attribute
config.include Kelp::Checkbox

0 comments on commit 0e045df

Please sign in to comment.