Sha256: 3a855a5f1b79a85fa8b0955b5e31dd69b0edac73c95df70e3a08e205fde7ab16

Contents?: true

Size: 735 Bytes

Versions: 25

Compression:

Stored size: 735 Bytes

Contents

require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper")

describe "hash_aliases extension" do
  before do
    @ds = Sequel.mock.dataset.extension(:hash_aliases)
  end

  it "should make from treat hash arguments as alias specifiers" do
    @ds.from(:a=>:b).sql.should == "SELECT * FROM a AS b"
  end

  it "should not affect other arguments to from" do
    @ds.from(:a, :b).sql.should == "SELECT * FROM a, b"
  end

  it "should make select treat hash arguments as alias specifiers" do
    @ds.select(:a=>:b).sql.should == "SELECT a AS b"
    @ds.select{{:a=>:b}}.sql.should == "SELECT a AS b"
  end

  it "should not affect other arguments to select" do
    @ds.select(:a, :b).sql.should == "SELECT a, b"
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
sequel-4.22.0 spec/extensions/hash_aliases_spec.rb
sequel-4.21.0 spec/extensions/hash_aliases_spec.rb
sequel-4.20.0 spec/extensions/hash_aliases_spec.rb
sequel-4.19.0 spec/extensions/hash_aliases_spec.rb
sequel-4.18.0 spec/extensions/hash_aliases_spec.rb
sequel-4.17.0 spec/extensions/hash_aliases_spec.rb
sequel-4.16.0 spec/extensions/hash_aliases_spec.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/hash_aliases_spec.rb
sequel-4.15.0 spec/extensions/hash_aliases_spec.rb
sequel-4.14.0 spec/extensions/hash_aliases_spec.rb
sequel-4.13.0 spec/extensions/hash_aliases_spec.rb
sequel-4.12.0 spec/extensions/hash_aliases_spec.rb
sequel-4.11.0 spec/extensions/hash_aliases_spec.rb
sequel-4.10.0 spec/extensions/hash_aliases_spec.rb
sequel-4.9.0 spec/extensions/hash_aliases_spec.rb
sequel-4.8.0 spec/extensions/hash_aliases_spec.rb
sequel-4.7.0 spec/extensions/hash_aliases_spec.rb
sequel-4.6.0 spec/extensions/hash_aliases_spec.rb
sequel-4.5.0 spec/extensions/hash_aliases_spec.rb
sequel-4.4.0 spec/extensions/hash_aliases_spec.rb