Sha256: fcc7eaf49e2ecccf83278a082120369ab5208f4e242c680401b30a3bc33f1c8c

Contents?: true

Size: 600 Bytes

Versions: 22

Compression:

Stored size: 600 Bytes

Contents

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

describe "from_block extension" do
  before do
    @db = Sequel.mock
    @db.extension(:from_block)
  end

  specify "should make Database#from blocks apply to FROM" do
    @db.from{f}.sql.should == 'SELECT * FROM f'
    @db.from{[f, g(f)]}.sql.should == 'SELECT * FROM f, g(f)'
  end

  specify "should handle from blocks with method arguments" do
    @db.from(:f){g(f)}.sql.should == 'SELECT * FROM f, g(f)'
  end

  specify "should handle from without block" do
    @db.from(:f).sql.should == 'SELECT * FROM f'
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

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