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
class TheController < ActionController::Base | |
self.view_paths = [File.join(File.dirname(__FILE__), '../fixtures/views')] | |
def index | |
respond_to do |format| | |
format.html do | |
@html = true | |
end | |
format.atom do | |
@atom = true |
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
# Stick this in features/step_definitions/scoped_webrat_steps.rb | |
# | |
# If your webrat steps defines: | |
# | |
# When /^I press "(.*)"$/ do |link| | |
# clicks_link(link) | |
# end | |
# | |
# Then this will also define: | |
# |
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
# example of a 'matrix' set of target versions with garlic | |
# | |
# just for kicks I stuck in all the 2.x stable branches, + some 3 different rspecs | |
# | |
# a better example would be keeping rspec constant, and where you have 2 real | |
# app dependencies | |
garlic do | |
repo 'nested_has_many_through', :path => '.' | |
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
xenon:~/dev/ianwhite/response_for(master)$ garlic shell | |
Garlic interactive session: type shell commands | |
garlic:> cd vendor/plugins/repsonse_for | |
vendor/plugins/repsonse_for: no such directory | |
garlic:> cd vendor/plugins/response_for | |
garlic:vendor/plugins/response_for> ruby spec/controllers/*.rb | |
2.1-stable: | |
................................................................................................... | |
Finished in 0.680104 seconds |
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
# Example of pickle: http://github.com/ianwhite/pickle | |
# | |
# Just knocked this up to provide an acceptance test for a bug. Took 2 mins | |
# | |
# All but the very first step, and the webrat steps, are pickle steps (there are 'category' and 'area' factories) | |
Feature: Fix bug #98, Categories should be able to have same title, when in different areas | |
Scenario: I should be able to create two categories called 'General Images' within two different areas | |
Given I am logged in as an admin |
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
# Snippet from inherit_views Rakefile | |
# | |
# The cruise (CI) task runs 'doc:publish' if the build passes | |
# This runs rdoc, and pushes to gh-pages (using grancher) if the | |
# doc dir is newer than the gh-pages ref in the local git repo | |
require 'hanna/rdoctask' | |
require 'garlic/tasks' | |
require 'grancher/task' | |
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
# just using ruby (see below) makes for a pretty easy fix in this case, but it could | |
# get pretty ugly pretty quick which a real world case. Having a 'One True Namespace' | |
# for conditions would keep the ugly at bay. | |
# | |
# So, I think I like the idea of using named_scope as a namespace for conditions (ie | |
# Luke's idea) | |
class Tag | |
has_many :taggings | |
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
ary.each do |i| | |
puts i | |
end.any? or puts 'none' |
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
Smoke.feed(:twitter) do | |
url "http://twitter.com/statuses/user_timeline/14431882.rss" | |
discard :title, /(@|#)/ | |
end | |
Smoke.feed(:delicious) do | |
url "http://feeds.delicious.com/v2/rss/bschwarz?count=15" | |
end | |
Smoke.data(:flickr) do |
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 VisitorHelper | |
# give this method an object or collection, optional other arguments, and a block. When you call visit within that block, the block itself will be called with the argument(s) | |
# | |
# <ul> | |
# <% visit tree do |node| %> | |
# <li> | |
# <%= node.name %> | |
# <ul><% visit node.children %></ul> | |
# </li> | |
# <% end %> |
OlderNewer