mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
spec:v1:sqlite3 works for running our specs
This commit is contained in:
parent
bd3ecd761e
commit
d12580a7ee
5 changed files with 27 additions and 0 deletions
12
Rakefile
12
Rakefile
|
@ -41,6 +41,18 @@ else
|
|||
|
||||
desc "Run specs with the #{adapter} database adapter"
|
||||
task adapter => "set_env_for_#{adapter}"
|
||||
|
||||
namespace :v1 do
|
||||
Spec::Rake::SpecTask.new(adapter) do |t|
|
||||
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
||||
t.libs << "#{File.dirname(__FILE__)}/spec"
|
||||
t.warning = true
|
||||
t.spec_files = FileList['spec/arel/**/*_spec.rb']
|
||||
end
|
||||
|
||||
desc "Run specs with the #{adapter} database adapter"
|
||||
task adapter => "set_env_for_#{adapter}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@ module Arel
|
|||
def eq other
|
||||
Nodes::Equality.new self, other
|
||||
end
|
||||
|
||||
def in other
|
||||
Nodes::In.new self, other
|
||||
end
|
||||
end
|
||||
|
||||
class String < Attribute; end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'arel/nodes/equality'
|
||||
require 'arel/nodes/in'
|
||||
require 'arel/nodes/sql_literal'
|
||||
require 'arel/nodes/select_core'
|
||||
require 'arel/nodes/select_statement'
|
||||
|
|
6
lib/arel/nodes/in.rb
Normal file
6
lib/arel/nodes/in.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
module Arel
|
||||
module Nodes
|
||||
class In < Equality
|
||||
end
|
||||
end
|
||||
end
|
|
@ -56,6 +56,10 @@ module Arel
|
|||
quote_table_name o.name
|
||||
end
|
||||
|
||||
def visit_Arel_Nodes_In o
|
||||
"#{visit o.left} IN (#{o.right.map { |x| quote visit x }.join ', '})"
|
||||
end
|
||||
|
||||
def visit_Arel_Nodes_Equality o
|
||||
"#{visit o.left} = #{quote visit o.right}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue