Sha256: 62a90c368541133fe2b703859cded99ec2b3d41450bcf76a5319fd67f2dbf38f

Contents?: true

Size: 832 Bytes

Versions: 15

Compression:

Stored size: 832 Bytes

Contents

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

if (RUBY_VERSION >= '2.0.0' && RUBY_ENGINE == 'ruby') || (RUBY_VERSION >= '2.3.0' && RUBY_ENGINE == 'jruby')
Sequel.extension :symbol_aref_refinement
using Sequel::SymbolAref

describe "symbol_aref_refinement extension" do
  before do
    @db = Sequel.mock
  end

  it "Symbol#[] should create qualified identifier if given a symbol" do
    @db.literal(:x[:y]).must_equal "x.y"
  end

  it "Symbol#[] should create qualified identifier if given an identifier" do
    @db.literal(:x[Sequel[:y]]).must_equal "x.y"
  end

  it "Symbol#[] should create qualified identifier if given a qualified identifier" do
    @db.literal(:x[:y[:z]]).must_equal "x.y.z"
  end

  it "should not affect other arguments to Symbol#[]" do
    :x[0].must_equal "x"
  end
end
end

Version data entries

15 entries across 13 versions & 2 rubygems

Version Path
sequel-4.49.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.48.0 spec/extensions/symbol_aref_refinement_spec.rb
tdiary-5.0.5 vendor/bundle/gems/sequel-4.44.0/spec/extensions/symbol_aref_refinement_spec.rb
tdiary-5.0.5 vendor/bundle/gems/sequel-4.47.0/spec/extensions/symbol_aref_refinement_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/sequel-4.44.0/spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.47.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.46.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.45.0 spec/extensions/symbol_aref_refinement_spec.rb
tdiary-5.0.4 vendor/bundle/gems/sequel-4.44.0/spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.44.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.43.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.42.1 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.42.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.41.0 spec/extensions/symbol_aref_refinement_spec.rb
sequel-4.40.0 spec/extensions/symbol_aref_refinement_spec.rb