Skip to content

Instantly share code, notes, and snippets.

View dchelimsky's full-sized avatar

David Chelimsky dchelimsky

  • Retired
  • Chicago, IL, USA
View GitHub Profile
it 'should do something' do
on_failure warn_that "@foo shouldn't be nil" do
@foo.should_not be_nil
end
end
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'cucumber' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
$:.unshift 'vendor/gems/cucumber-0.1.6/lib'
<%=h status %>
<% content_for :footer %>
<%=h footer %>
<% end %>
describe ProjectsController do
describe :get => :show, :id => '37' do
expects :find, :on => Project, :with => { :id => '37' }, :returns => mock_project
assigns :project
describe "mime XML" do
mime Mime::XML
#
end
end
require 'rubygems'
require 'spec'
class MyExampleGroup < Spec::ExampleGroup
before(:each) do
puts "in before(:each)"
my_custom_method
end
class << self
Scenario Outline: Religious menus
Given the customer is "<Religion>"
When he asks for the menu
Then he should be presented with the appropriate selection from <Pork>, <Lamb>, or <Veal>
Scenarios:
| Religion | Pork | Lamb | Veal |
| Christian | Y | Y | Y |
| Jewish | | Y | Y |
| Muslim | | Y | Y |
describe Scorecard::Score::BusinessCapacityScore,"benchmark" do
before do
@business_capacity = Scorecard::Score::BusinessCapacityScore.new
@business_capacity.ues = false
@stream_fields = @business_capacity.assistance_type_stream_fields
end
@stream_fields.each do |stream_label|
it "should get the stream: #{stream_label}" do
describe Customer, "last billing address" do
before do
@customer = Customer.generate!
@customer = Address.new
end
it "should be settable and gettable" do
@customer.last_billing_address = @account_address
@customer.last_billing_address.should == @account_address
end
...
Scenario "has three steps" do
Given "one" do
end
When "two" do
end
Then "three" do
end
class Game
attr_reader :teams
def initialize
@teams = Array.new
end
def started?
false