spec/support/driver_indexes_collection.rb in baza-0.0.17 vs spec/support/driver_indexes_collection.rb in baza-0.0.18
- old
+ new
@@ -1,16 +1,9 @@
shared_examples_for "a baza indexes driver" do
- let(:constant){
- name = described_class.name.split("::").last
- const_name = "Info#{name.slice(0, 1).upcase}#{name.slice(1, name.length)}"
- require "#{File.dirname(__FILE__)}/../info_#{StringCases.camel_to_snake(name)}"
- raise "Constant was not defined: '#{const_name}'." unless Baza.const_defined?(const_name)
- Baza.const_get(const_name)
- }
- let(:driver){ constant.new }
- let(:db){ driver.db }
- let(:test_table){
+ let(:driver) { constant.new }
+ let(:db) { driver.db }
+ let(:test_table) do
db.tables.create("test", {
columns: [
{name: "id", type: :int, autoincr: true, primarykey: true},
{name: "text", type: :varchar},
{name: "email", type: :varchar}
@@ -19,10 +12,10 @@
:text,
{name: :email, unique: true, columns: [:email]}
]
})
db.tables[:test]
- }
+ end
before do
driver.before
end