Skip to content

Instantly share code, notes, and snippets.

View snuggs's full-sized avatar
👤
Committing

Ahmid-Ra snuggs

👤
Committing
View GitHub Profile
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
# (T) - Twitter Updates
# id = Arel::Attributes::Integer.new nil, :id
# update = Arel::Attributes::String.new nil, :update
# tuples = [[1, "Hai I can haz cheezburgerz"], [2, "Nom!"], [0, "What can you haz?"]]
# headers = [Arel::Attributes::Integer.new(nil, :id), Arel::Attributes::String.new(nil, :update)]
# updates = Arel::Array.new tuples, headers
# find_twitter_user_updates_predicate = Arel::Predicates::Equality.new updates[:id], 9
module Arel
class TwitterArray
include Relation
attr_reader :array, :attribute_names_and_types
include Recursion::BaseCase
ATTR_MAP = {
:twitter_name => Attributes::String,
:id => Attributes::Integer,