Skip to content

Instantly share code, notes, and snippets.

View aslakhellesoy's full-sized avatar
🤠
typing...

Aslak Hellesøy aslakhellesoy

🤠
typing...
View GitHub Profile
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
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
module Cucumber
module Parser
grammar Table
rule record
cell_value / (cell_value separator record)
end
rule separator
'|'
end
# 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|
# foo.feature
Feature: Foo
Background: Bar
Given Cukes
Then Happy
Scenario: One
Given Java
Scenario: Two
Given Ruby
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
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
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
## 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
it 'should do something' do
on_failure warn_that "@foo shouldn't be nil" do
@foo.should_not be_nil
end
end