This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: rails | |
rails: --require features/support/rails_env --require features/step_definitions/common --require features/step_definitions/rails/ features/rails/ | |
browser: --require features/support/browser_env --require features/step_definitions/common --require features/step_definitions/browser features/browser/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Cucumber | |
module Parser | |
grammar Table | |
rule record | |
(cell_value separator record) / cell_value | |
end | |
rule separator | |
'|' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Cucumber | |
# :stopdoc: | |
module TreetopParser | |
grammar Feature | |
rule root | |
space? header scenario_sequence space? { | |
def compile | |
feature_elements = scenario_sequence.compile | |
feature = Cucumber::Ast::Feature.new(nil, nil, header.text_value.strip, feature_elements) | |
feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Backgrounds | |
In order to provide a context to my scenarios within a feature | |
As a feature editor | |
I want to write a background section in my features. | |
Scenario: run a scenario with a background with a passing step | |
When I run cucumber -q features/passing_background_sample.feature:6 | |
Then it should pass with | |
""" | |
Feature: sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario Outline: passing background | |
Then I should have '<count>' cukes | |
Examples: | |
| count | | |
| Background: | |
Given '10' cukes | |
10 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: backgrounds | |
In order to provide a context to my scenarios within a feature | |
As a feature editor | |
I want to write a background section in my features. | |
Scenario: run a feature with a background that passes | |
When I run cucumber -q features/passing_background.feature | |
Then it should pass with | |
""" | |
Feature: sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# trying out the scenario outlines cucumber feature | |
$ gem list cucumber; gem list webrat | |
*** LOCAL GEMS *** | |
cucumber (0.1.16) | |
webrat (0.4.1) | |
# the feature we are trying features/manage_cukes.feature | |
Feature: Manage cukes | |
In order to use scenario outlines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the feature we are trying features/manage_cukes.feature | |
Feature: Manage cukes | |
In order to use scenario outlines | |
everything should work | |
Scenario Outline: Testing scenario outlines # examples/tickets/test.feature:6 | |
Given there are <cuke_versions> | |
Examples: | |
| cuke_versions | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'trollop' | |
config = {:step_type => 'Given,When,Then'} | |
opts = Trollop.options do | |
opt :step_type, "Given, When or Then", :type => :string, :default => config[:step_type] | |
end | |
term = ARGV.last | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Run cucumber features with real browser" | |
task :browser => ['features:start', 'cuke_browser'] | |
Cucumber::Rake::Task.new(:cuke_browser) do |t| | |
t.cucumber_opts = "--profile browser" | |
t.feature_list = [] | |
t.step_list = [] | |
end | |
namespace :features do |