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
it 'should do something' do | |
on_failure warn_that "@foo shouldn't be nil" do | |
@foo.should_not be_nil | |
end | |
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 ObjectLocators | |
def the_policy | |
if @policy | |
@policy | |
else | |
case Policy.count | |
when 0 | |
raise "There is no @policy variable defined and no policy in the DB! Establish state in previous step or create a new policy." | |
when 1 |
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 'rack/test' | |
require 'webrat' | |
require File.expand_path(File.dirname(__FILE__) + '/../../lib/stats') | |
Webrat.configure do |config| | |
config.mode = :rack | |
end | |
Stats::App.set :environment, 'cucumber' | |
Stats::App.enable :raise_errors |
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
describe "My Test" do | |
before(:all) { puts "Running..."} | |
describe "something" do | |
it "should have a cool name" do | |
"name" | |
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
My view is that we have two domains here - the specification domain, and the execution domain. Gherkin parses the specification model, The compiler translates from the specification model into the execution domain. | |
The formatters observe the execution, so should operate in that domain. The execution domain model has a mapping to the specification model which created it, so formatters can look up to find out, for example, the feature that a unit comes from, or whether a statement is from a background step or not. | |
before_features(features) # this allows the formatter to visit the specification model and build whatever representation of that model it wants to (e.g. count scenarios for a progress bar) | |
before_unit(unit) # unit could be a scenario or example row | |
before_statement(statement) # statement could be a Before/After hook, a background step or regular step | |
after_statement(statement, statement_result) | |
after_unit(unit, unit_result) | |
after_features |
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 'spec_helper' | |
describe PhotoAlbum do | |
describe 'adding a new photo' do | |
describe "when the album has no photos" do | |
before(:each) do | |
@photo_album = stub_model(PhotoAlbum) | |
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
When /^I fill the captcha incorrectly$/ do | |
captcha_evaluates_to false | |
end | |
When /^I fill the captcha correctly$/ do | |
captcha_evaluates_to true | |
end | |
module ShortCircuit | |
attr_accessor :short_circuit_to |
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 EventsHelper | |
def create_events(events_table) | |
events_table.map_headers! {|header| header.is_a?(Symbol) ? header : header.gsub(/\s/,'_').to_sym } | |
system_time = TimeService.now | |
events_table.hashes.each do |event| | |
event[:name] ||= "Event #{system_time.strftime("%H:%M:%S")}" | |
event[:enabled] ||= true | |
event[:time] ||= system_time |
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
#create_club.feature | |
Scenario: Admin adds a club with valid information | |
Given I am signed in as an admin with the email "admin@admin.com" | |
And the city "Barcelona" already exists | |
And I go to the new club page | |
When I fill in the following: | |
| Nombre | Ribelinos | | |
| Calle | Avda. Diagonal | | |
| Número | 661 | |
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
[bar, dog, foo, { c => [rat, cat, dog] }, a, b] | |
- bar | |
- dog | |
- foo | |
- c: | |
- rat | |
- cat | |
- dog | |
- a |
OlderNewer