From 487df1771ded1fb065a53ebe9d1a5a9c119478e3 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 24 Sep 2010 09:41:48 -0700 Subject: adding an oracle visitor --- spec/arel/select_manager_spec.rb | 4 ++++ spec/arel/visitors/oracle_spec.rb | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 spec/arel/visitors/oracle_spec.rb (limited to 'spec/arel') diff --git a/spec/arel/select_manager_spec.rb b/spec/arel/select_manager_spec.rb index f301e3afd0..7002d937a2 100644 --- a/spec/arel/select_manager_spec.rb +++ b/spec/arel/select_manager_spec.rb @@ -15,6 +15,10 @@ module Arel @config = { :adapter => 'sqlite3' } end + def with_connection + yield self + end + def connection self end diff --git a/spec/arel/visitors/oracle_spec.rb b/spec/arel/visitors/oracle_spec.rb new file mode 100644 index 0000000000..384725b788 --- /dev/null +++ b/spec/arel/visitors/oracle_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +module Arel + module Visitors + describe 'the oracle visitor' do + before do + @visitor = Oracle.new Table.engine + end + + describe 'Nodes::SelectStatement' do + describe 'limit' do + it 'adds a rownum clause' do + stmt = Nodes::SelectStatement.new + stmt.limit = 10 + sql = @visitor.accept stmt + sql.should be_like %{ SELECT WHERE ROWNUM <= 10 } + end + end + end + end + end +end -- cgit v1.2.3