Sha256: d2be3c2fa974b0fd8c79a1855db1290ab9128848184210ef3fa63ef46337dc3c

Contents?: true

Size: 489 Bytes

Versions: 45

Compression:

Stored size: 489 Bytes

Contents

require_relative "spec_helper"

describe "Sequel::Plugins::SingularTableNames" do
  before do
    @c = Class.new(Sequel::Model)
    @c.plugin :singular_table_names
  end
  after do
    Object.send(:remove_const, :Foo)
  end

  it "should not used the pluralized table name" do
    class ::Foo < @c; end
    Foo.table_name.must_equal :foo
  end

  it "should handle nested moedls name" do
    module ::Foo; end
    class Foo::Bar < @c; end
    Foo::Bar.table_name.must_equal :bar
  end
end

Version data entries

45 entries across 41 versions & 2 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/sequel-5.26.0/spec/extensions/singular_table_names_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/sequel-5.26.0/spec/extensions/singular_table_names_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/spec/extensions/singular_table_names_spec.rb
sequel-5.29.0 spec/extensions/singular_table_names_spec.rb
sequel-5.28.0 spec/extensions/singular_table_names_spec.rb
sequel-5.27.0 spec/extensions/singular_table_names_spec.rb
tdiary-5.1.0 vendor/bundle/gems/sequel-5.26.0/spec/extensions/singular_table_names_spec.rb
sequel-5.26.0 spec/extensions/singular_table_names_spec.rb
sequel-5.25.0 spec/extensions/singular_table_names_spec.rb
sequel-5.24.0 spec/extensions/singular_table_names_spec.rb
sequel-5.23.0 spec/extensions/singular_table_names_spec.rb
sequel-5.22.0 spec/extensions/singular_table_names_spec.rb
sequel-5.21.0 spec/extensions/singular_table_names_spec.rb
sequel-5.20.0 spec/extensions/singular_table_names_spec.rb
tdiary-5.0.13 vendor/bundle/gems/sequel-5.18.0/spec/extensions/singular_table_names_spec.rb
sequel-5.19.0 spec/extensions/singular_table_names_spec.rb
tdiary-5.0.12.1 vendor/bundle/gems/sequel-5.18.0/spec/extensions/singular_table_names_spec.rb
sequel-5.18.0 spec/extensions/singular_table_names_spec.rb
sequel-5.17.0 spec/extensions/singular_table_names_spec.rb
sequel-5.16.0 spec/extensions/singular_table_names_spec.rb