Skip to content

Instantly share code, notes, and snippets.

@diabolo
Created June 17, 2009 15:09
Show Gist options
  • Save diabolo/131277 to your computer and use it in GitHub Desktop.
Save diabolo/131277 to your computer and use it in GitHub Desktop.
describe Customer, "last billing address" do
before do
@customer = Customer.generate!
@customer = Address.new
end
it "should be settable and gettable" do
@customer.last_billing_address = @account_address
@customer.last_billing_address.should == @account_address
end
...
end
describe Customer, "last delivery address" do
before do
@customer = Customer.generate!
@account_address = Address.new
end
it "should be settable and gettable" do
@customer.last_delivery_address = @account_address
@customer.last_delivery_address.should == @account_address
end
end
share_examples_for "named address" do
it "should be settable and gettable" do
named_address = @account_address
@named_address.should == @account_address
end
end
describe Customer, "last billing address" do
it_should_behave_like "named address"
before do
named_address = @customer.last_billing_address=
@named_address = @customer.last_billing_address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment