Skip to content

Instantly share code, notes, and snippets.

class A
def goal
1
end
end
a = A.new
[a, a, a].sum(&:goal) #=> 3
As a
I want
So that
In our experience the "So that" was too often ignored or not given the attention it deserved.
Roles are easy to figure out, as is what features people want. The hardest thing to put into words and
arguably the most important is what value this feature provides.
This story format (attributed to Liz Keogh here: http://www.agilemanagement.net/Articles/Weblog/NewUserStoryFormat.html)
module ThinkingSphinx
class SpecHelper
def start_sphinx
system('rake', 'ts:start', 'RAILS_ENV=test')
end
def stop_sphinx
system('rake', 'ts:stop', 'RAILS_ENV=test')
end
namespace :thinking_sphinx do
namespace :test do
def usage
"thinking_sphinx:test:prepare"
end
desc "Indexes test environment to allow integration testing"
task :prepare do
ENV['RAILS_ENV'] = 'test'
Rake::Task["thinking_sphinx:index"].invoke
end
class SessionsController < ApplicationController
include Clearance::App::Controllers::SessionsController
layout :session
end
%table
%tr
%th.label &nbsp;
%th.label bigtiger
%th.label l4rk
%th.label tpope
%th.label sandro
%th.label leshill
%tr
%td.label bigtiger
Module.class_eval do
def temporal_const(name, value)
const_set(name, value)
yield
remove_const(name)
end
end
in use ...
# Reparse a URL to get a hash of route params.
>> url ="/New-Homes/Search/Georgia/Atlanta/townhome-5000000-maximum-price-100000-minimum-price-5d6qe+5d6tw+5d6sv"
=> "/New-Homes/Search/Georgia/Atlanta/townhome-5000000-maximum-price-100000-minimum-price-5d6qe+5d6tw+5d6sv"
>> ActionController::Routing::Routes.recognize_path(url)
=> {:state=>"Georgia", :action=>"index", :refinement=>"townhome-5000000-maximum-price-100000-minimum-price-5d6qe+5d6tw+5d6sv", :city=>"Atlanta", :controller=>"communities", :channel=>"Search"}
# Note: The New-Homes segment is a prefix in our routes and not returned in the params.
bigt:~/git_hashrocket/namecheap$ !spec
spec -c spec/*_spec.rb
..........*.
Pending:
NamecheapAPI Wrapper#is_domain_available? should return true if connections succeeds and domain is available (Need API Access To Namecheap.com)
Called from ./spec/namecheap_spec.rb:28
Finished in 6.14485 seconds
Project T
sqlite3
real 2m30.829s
user 1m58.699s
sys 0m25.293s
1 failure due to database specific sql
mysql