This file contains hidden or 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 PostsController do | |
it "should show the given post on GET show" do | |
post = stub('a post', :to_param => '1') | |
Post.expects(:find).with(post.to_param).returns(post) | |
get :show, :id => post.to_param | |
should render_template(:show) | |
should assign_to(:post).with(post) | |
end |
This file contains hidden or 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 PostsController, "on GET show" do | |
before(:each) do | |
@post = stub('a post', :to_param => '1') | |
Post.expects(:find).with(@post.to_param).returns(@post) | |
get :show, :id => @post.to_param | |
end | |
it { should render_template(:show) } | |
it { should assign_to(:post).with(@post) } |
This file contains hidden or 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 PostsController, "on GET show" do | |
before(:each) do | |
@post = stub('a post', :to_param => '1') | |
Post.stubs(:find => @post) | |
get :show, :id => @post.to_param | |
end | |
it { should render_template(:show) } |
This file contains hidden or 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 GeoKit | |
module Geocoders | |
class FakeGeocoder < Geocoder | |
def self.locations | |
@locations ||= {} | |
end | |
def self.geocode(location) | |
loc = GeoLoc.new | |
if locations.key?(location) |
This file contains hidden or 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
#!/usr/bin/ruby | |
unless failing_feature = ARGV[0] | |
puts "Usage: find-interacting-feature <feature_file>" | |
exit | |
end | |
other_features = Dir["features/**/*.feature"] - [failing_feature] | |
interacting_feature = other_features.detect do |other_feature| |
This file contains hidden or 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
class Test::Unit::TestCase | |
def self.should_should_belong_to(association) | |
should "should belong to #{association}" do | |
assert instance_methods.include?("should belong to #{association}") | |
end | |
end | |
end |
This file contains hidden or 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
# autocompletion for cuc | |
_cucumber_features() { | |
compadd `ls features/**/*.feature | sed "s/features\/\(.*\).feature/\1/"` | |
} | |
compdef _cucumber_features cuc |