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 "Given logged in, Homepage: url(:home)" do | |
before(:each) do | |
@rack = request(:home) | |
login | |
end | |
it "allows the user to visit" do | |
@rack.should be_successful | |
@rack.body.should == "Welcome" | |
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
describe Controller do | |
before(:each) do | |
@model = mock("model").as_null_object | |
@view = mock("view").as_null_object | |
@controller = Controller.new(@model, @view) | |
end | |
def act | |
@return_value = @controller.act_on(:some_input) | |
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 | |
module Parser | |
grammar Table | |
rule record | |
cell_value / (cell_value separator record) | |
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
# Usage: | |
# ruby sha1sum.rb FILE | |
# | |
# Compare results with http://en.wikipedia.org/wiki/Sha1sum | |
# http://lists.gnupg.org/pipermail/gnupg-announce/2004q4/000184.html (Windows) | |
require 'digest/sha1' | |
hashfunc = Digest::SHA1.new | |
open(ARGV[0], "rb") do |io| |
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
# foo.feature | |
Feature: Foo | |
Background: Bar | |
Given Cukes | |
Then Happy | |
Scenario: One | |
Given Java | |
Scenario: Two | |
Given Ruby | |
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
Given /^I am logged in as "(.+)"$/ do |user| | |
Given %{a user exists with login "#{user}" and password "thedude"} | |
Given %{I go to /login" | |
Given %{I fill in "login" with "#{user}"} | |
Given %{I fill in "password" with "thedude"} | |
Given %{I press "Login"} | |
end | |
Scenario Outline: Shortcode Generated |
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: submit guess | |
The code-breaker submits a guess of four colored | |
pegs. The mastermind game marks the guess with black | |
and white "marker" pegs. | |
For each peg in the guess that matches color | |
and position of a peg in the secret code, the | |
mark includes one black peg. For each additional | |
peg in the guess that matches the color but not |
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: submit guess | |
The code-breaker submits a guess of four colored | |
pegs. The mastermind game marks the guess with black | |
and white "marker" pegs. | |
For each peg in the guess that matches color | |
and position of a peg in the secret code, the | |
mark includes one black peg. For each additional | |
peg in the guess that matches the color but not |
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
## NOTE | |
The error refers to the first line of the second multi-line pre-scenario comments | |
## sessions.feature file | |
Users want to know that nobody can masquerade as them. We want to extend trust | |
only to visitors who present the appropriate credentials. Everyone wants this | |
identity verification to be as secure and convenient as possible. | |
Feature: Logging in |
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 |
OlderNewer