This file contains hidden or 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
| # in feature/step_definitions/steps.rb | |
| Given "blah" do | |
| do_it | |
| end | |
| module MoreWorld | |
| extend self | |
| def do_it | |
| p "Do it" |
This file contains hidden or 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
| require 'gherkin' | |
| require 'gherkin/builder' | |
| gherkin = Gherkin::Builder.new do | |
| feature "Addition" do | |
| description "In order to avoid silly mistakes..." | |
| scenario_outline "Add two numbers" do | |
| step :given, "I have entered <input_1> into the calculator" | |
| step :and, "I have entered <input_2> into the calculator" |
This file contains hidden or 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
| msassak@xanthippe:~/Work/cucumber(api) $ belly | |
| /Users/msassak/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- belly/credentials (LoadError) | |
| from /Users/msassak/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
| from /Users/msassak/.rvm/gems/ruby-1.8.7-p302@cucumber/gems/belly-0.5.5/bin/../lib/belly/client/config.rb:2 | |
| from /Users/msassak/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' | |
| from /Users/msassak/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
| from /Users/msassak/.rvm/gems/ruby-1.8.7-p302@cucumber/gems/belly-0.5.5/bin/../lib/belly/client.rb:60 | |
| from /Users/msassak/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' | |
| from /Users/msassak/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31: |
This file contains hidden or 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 LastRequestResponse | |
| def last_request | |
| page.driver.last_request | |
| end | |
| def last_response | |
| page.driver.last_response | |
| end | |
| end |
This file contains hidden or 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
| require 'strscan' | |
| singleton = <<EOS | |
| Feature: Singletonz | |
| Scenario: Oh hai | |
| Given what is this here | |
| %_FEATURE_END_% | |
| EOS |
This file contains hidden or 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: Pipes Are the Waves of the Future | |
| Scenario: This is a scenario living in a gist | |
| Given a step blah | |
| And another one | |
| Then McGlarble | |
| Scenario: Real step | |
| Then STDERR should be empty |
This file contains hidden or 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
| # | |
| # With Gherkin 2.0 we do something like this: | |
| def parse | |
| builder = Cucumber::Parser::GherkinBuilder.new | |
| formatter_listener = Gherkin::Parser::FormatterListener.new(builder) | |
| filter_listener = Gherkin::Parser::FilterListener.new(formatter_listener, filters) | |
| parser = Gherkin::Parser::Parser.new(filter_listener, true, "root") | |
| lexer = Gherkin::I18nLexer.new(parser, false) | |
| lexer.scan(source, location, offset) |
This file contains hidden or 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
| class Cucumber::Ast::Table | |
| def expand_dittos(ditto = "''") | |
| ditto_rows = rows.dup | |
| ditto_rows.each_cons(2) do |upper, lower| | |
| next unless lower.any? { |cell| cell == ditto } | |
| lower.each_with_index do |cell, idx| | |
| lower[idx] = upper[idx] if cell == ditto | |
| end | |
| end |
This file contains hidden or 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 TestWorld | |
| def log_in | |
| puts "Logging in" | |
| end | |
| def log_out | |
| puts "Logging out" | |
| end | |
| end |
This file contains hidden or 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: scenario outline test | |
| Scenario Outline: main table for now | |
| Given an event starts at <TimeA> in <CreateTMZ> | |
| When a user in <ViewTMZ> views the event | |
| Then it will show as starting at <TimeB> | |
| And <Note> | |
| Examples: | |
| | CreateTMZ | TimeA | ViewTMZ | TimeB | Note | |