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
sequel-5.3.0 spec/extensions/singular_table_names_spec.rb
sequel-5.2.0 spec/extensions/singular_table_names_spec.rb
sequel-5.1.0 spec/extensions/singular_table_names_spec.rb
tdiary-5.0.6 vendor/bundle/gems/sequel-5.0.0/spec/extensions/singular_table_names_spec.rb
sequel-5.0.0 spec/extensions/singular_table_names_spec.rb