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
@dchelimsky
dchelimsky / gist:24369
Created November 13, 2008 05:04 — forked from dkubb/gist:5524
resource 'posts/:id' do |id|
get do
# show post id
end
delete do
# destroy post id
end
get :comments do
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
given "logged in" do
login
end
given "anonymous" do end
describe "Homepage: url(:home)", :given => "logged in" do
before(:each) do
@rack = request(:home)
end
@dchelimsky
dchelimsky / an example
Created September 30, 2008 14:01 — forked from zdennis/an example
require File.dirname(__FILE__) + '/../spec_helper'
class Foo
def self.per_page
10
end
end
describe Foo do
should_have_per_page 10
<p><b>Title:</b> <%=h @race.title %></p>
<p><b>State:</b> <%=h @race.state.title %></p>
<p><b>Racetype:</b> <%=h @race.racetype.title %></p>
<hr>
<h3>Questions</h3>
<% form_tag :action => :manage_questions, :id => @race do %>
<table>
Spec::Matchers.create(:be_successful) do
matches do |rack|
rack.status == 200
end
message do |not_string, rack|
"Expected #{describe_request(rack)}#{not_string} " \
"to be successful, but it returned a #{rack.status}"
end
end
require 'spec_helper.rb'
describe "Migration" do
before(:all) do
MyModel = Object.new
require 'my_migration'
end
before(:each) do