Skip to content

Instantly share code, notes, and snippets.

require File.join(File.dirname(__FILE__), "spec_helper")
describe Merb::Router do
describe "#match" do
it "should raise an error if the routes were not compiled yet" do
lambda { Merb::Router.match(simple_request) }.should raise_error(Merb::Router::NotCompiledError)
end
#!/usr/bin/env ruby
require 'rubygems'
require 'dm-core'
class Zoo
include DataMapper::Resource
property :id, Serial
end
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper_new'))
describe "I don't know what's going on" do
load_models_for_metaphor :zoo
before(:each) do
DataMapper.auto_migrate!
repository(:secondary) { DataMapper.auto_migrate! }
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>PostgreSQL</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
it "should create when dirty" do
pending
lambda do
Zoo.new(:city => "San Diego").save
end.should change(Zoo, :all).by(1)
end
it "should save child assosciations" do
repository(ADAPTER) do
animal = Animal.new
@zoo.animals << animal
@zoo.save
animal.new_record?.should be_false
end
end
describe '#save' do
describe 'with a new resource' do
it "should save child assosciations"
it "should set defaults before create"
it "should create when the resource is dirty" do
zoo = Zoo.new
zoo.name = "San Diego"
zoo.should_receive(:create)