Skip to content

Instantly share code, notes, and snippets.

@miloops
Created December 27, 2009 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miloops/264373 to your computer and use it in GitHub Desktop.
Save miloops/264373 to your computer and use it in GitHub Desktop.
require 'spec_helper'
module Arel
describe Table do
before do
@relation = Table.new(:users)
end
describe '#to_sql' do
it "manufactures a simple select query" do
sql = @relation.from("workers").to_sql
adapter_is :mysql do
sql.should be_like(%Q{
SELECT `users`.`id`, `users`.`name`
FROM workers
})
end
adapter_is_not :mysql do
sql.should be_like(%Q{
SELECT "users"."id", "users"."name"
FROM workers
})
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment