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
require 'open-uri' | |
require 'fastercsv' | |
class ZoneFinder | |
# Creates a ZoneFinder object | |
def initialize(network_data_path) | |
@network_data_path = network_data_path | |
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 ValidationTestHelper | |
def assert_valid(field, *values) | |
__model_check__ | |
values.flatten.each do |value| | |
o = __setup_model__(field, value) | |
if o.valid? | |
assert_block { true } | |
else | |
messages = [o.errors[field]].flatten | |
assert_block("unexpected invalid field <#{o.class}##{field}>, value: <#{value.inspect}>, errors: <#{o.errors[field].inspect}>.") { false } |
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: Compile C code into Ruby extensions. | |
In order to automate compilation process. | |
As a Gem developer. | |
I want rake tasks compile source code for me. | |
Scenario: Compile single extension | |
Given a safe project directory | |
And scaffold code for extension 'extension_one' | |
And 'tmp' folder is deleted |
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
require 'set' | |
module BagOfMatchers | |
class Bag | |
def initialize(list) | |
@list = Set.new(list) | |
end | |
def matches?(list) |
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 step_definitions/common --require step_definitions/rails rails/ | |
browser: --require step_definitions/common --require step_definitions/selenium 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
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
grammar Gherkin; | |
//options { | |
// language=Ruby; | |
//} | |
feature : NEWLINE* comment? NEWLINE* SPACE* tags? NEWLINE* SPACE* feature_keyword SPACE* line_to_eol NEWLINE+ (feature_elements .)* feature_elements ; | |
fragment | |
feature_elements |
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 |
OlderNewer