spec/adapters/sqlanywhere_spec.rb in sequel-4.22.0 vs spec/adapters/sqlanywhere_spec.rb in sequel-4.23.0
- old
+ new
@@ -22,56 +22,56 @@
end
after do
@db.drop_table(:booltest)
end
- specify "should consider smallint datatypes as boolean if set, but if not, as larger smallints" do
+ it "should consider smallint datatypes as boolean if set, but if not, as larger smallints" do
@db.create_table!(:booltest){column :b, 'smallint'; column :i, 'integer'}
- @db.schema(:booltest, :reload=>true).first.last[:type].should == :boolean
- @db.schema(:booltest, :reload=>true).first.last[:db_type].should match /smallint/i
+ @db.schema(:booltest, :reload=>true).first.last[:type].must_equal :boolean
+ @db.schema(:booltest, :reload=>true).first.last[:db_type].must_match /smallint/i
Sequel::SqlAnywhere.convert_smallint_to_bool = false
@db2 = Sequel.connect(DB.url)
- @db2.schema(:booltest, :reload=>true).first.last[:type].should == :integer
- @db2.schema(:booltest, :reload=>true).first.last[:db_type].should match /smallint/i
+ @db2.schema(:booltest, :reload=>true).first.last[:type].must_equal :integer
+ @db2.schema(:booltest, :reload=>true).first.last[:db_type].must_match /smallint/i
- @db.schema(:booltest, :reload=>true).first.last[:type].should == :boolean
- @db.schema(:booltest, :reload=>true).first.last[:db_type].should match /smallint/i
+ @db.schema(:booltest, :reload=>true).first.last[:type].must_equal :boolean
+ @db.schema(:booltest, :reload=>true).first.last[:db_type].must_match /smallint/i
@db2.disconnect
end
describe "datasets" do
- specify "should return smallints as bools and integers as integers when set" do
+ it "should return smallints as bools and integers as integers when set" do
@ds.delete
@ds << {:b=>true, :i=>10}
- @ds.all.should == [{:b=>true, :i=>10}]
+ @ds.all.must_equal [{:b=>true, :i=>10}]
@ds.delete
@ds << {:b=>false, :i=>0}
- @ds.all.should == [{:b=>false, :i=>0}]
+ @ds.all.must_equal [{:b=>false, :i=>0}]
@ds.delete
@ds << {:b=>true, :i=>1}
- @ds.all.should == [{:b=>true, :i=>1}]
+ @ds.all.must_equal [{:b=>true, :i=>1}]
end
- specify "should return all smallints as integers when unset" do
+ it "should return all smallints as integers when unset" do
Sequel::SqlAnywhere.convert_smallint_to_bool = false
@db2 = Sequel.connect(DB.url)
@ds2 = @db2[:booltest]
@ds2.delete
@ds2 << {:b=>true, :i=>10}
- @ds2.all.should == [{:b=>1, :i=>10}]
+ @ds2.all.must_equal [{:b=>1, :i=>10}]
@ds2.delete
@ds2 << {:b=>false, :i=>0}
- @ds2.all.should == [{:b=>0, :i=>0}]
+ @ds2.all.must_equal [{:b=>0, :i=>0}]
@ds2.delete
@ds2 << {:b=>1, :i=>10}
- @ds2.all.should == [{:b=>1, :i=>10}]
+ @ds2.all.must_equal [{:b=>1, :i=>10}]
@ds2.delete
@ds2 << {:b=>0, :i=>0}
- @ds2.all.should == [{:b=>0, :i=>0}]
+ @ds2.all.must_equal [{:b=>0, :i=>0}]
@db2.disconnect
end
end
end
@@ -82,49 +82,49 @@
end
after do
@db.drop_table(:booltest)
end
- specify "should consider smallint datatypes as boolean if set, but not larger smallints" do
- @db.schema(:booltest, :reload=>true).first.last[:type].should == :boolean
- @db.schema(:booltest, :reload=>true).first.last[:db_type].should match /smallint/i
+ it "should consider smallint datatypes as boolean if set, but not larger smallints" do
+ @db.schema(:booltest, :reload=>true).first.last[:type].must_equal :boolean
+ @db.schema(:booltest, :reload=>true).first.last[:db_type].must_match /smallint/i
@db.convert_smallint_to_bool = false
- @db.schema(:booltest, :reload=>true).first.last[:type].should == :integer
- @db.schema(:booltest, :reload=>true).first.last[:db_type].should match /smallint/i
+ @db.schema(:booltest, :reload=>true).first.last[:type].must_equal :integer
+ @db.schema(:booltest, :reload=>true).first.last[:db_type].must_match /smallint/i
end
describe "datasets" do
- specify "should return smallints as bools and integers as integers when set" do
+ it "should return smallints as bools and integers as integers when set" do
@ds = @db[:booltest]
@ds.delete
@ds << {:b=>true, :i=>10}
- @ds.all.should == [{:b=>true, :i=>10}]
+ @ds.all.must_equal [{:b=>true, :i=>10}]
@ds.delete
@ds << {:b=>false, :i=>0}
- @ds.all.should == [{:b=>false, :i=>0}]
+ @ds.all.must_equal [{:b=>false, :i=>0}]
@ds.delete
@ds << {:b=>true, :i=>1}
- @ds.all.should == [{:b=>true, :i=>1}]
+ @ds.all.must_equal [{:b=>true, :i=>1}]
end
- specify "should return all smallints as integers when unset" do
+ it "should return all smallints as integers when unset" do
@db2 = Sequel.connect(DB.url)
@db2.convert_smallint_to_bool = false
@ds2 = @db2[:booltest]
@ds2.delete
@ds2 << {:b=>true, :i=>10}
- @ds2.all.should == [{:b=>1, :i=>10}]
+ @ds2.all.must_equal [{:b=>1, :i=>10}]
@ds2.delete
@ds2 << {:b=>false, :i=>0}
- @ds2.all.should == [{:b=>0, :i=>0}]
+ @ds2.all.must_equal [{:b=>0, :i=>0}]
@ds2.delete
@ds2 << {:b=>1, :i=>10}
- @ds2.all.should == [{:b=>1, :i=>10}]
+ @ds2.all.must_equal [{:b=>1, :i=>10}]
@ds2.delete
@ds2 << {:b=>0, :i=>0}
- @ds2.all.should == [{:b=>0, :i=>0}]
+ @ds2.all.must_equal [{:b=>0, :i=>0}]
@db2.disconnect
end
end
end
@@ -136,35 +136,35 @@
end
after do
@db.drop_table(:booltest)
end
- specify "should return smallints as bools and integers as integers when set" do
+ it "should return smallints as bools and integers as integers when set" do
@ds.delete
@ds << {:b=>true, :i=>10}
- @ds.all.should == [{:b=>true, :i=>10}]
+ @ds.all.must_equal [{:b=>true, :i=>10}]
@ds.delete
@ds << {:b=>false, :i=>0}
- @ds.all.should == [{:b=>false, :i=>0}]
+ @ds.all.must_equal [{:b=>false, :i=>0}]
@ds.delete
@ds << {:b=>true, :i=>1}
- @ds.all.should == [{:b=>true, :i=>1}]
+ @ds.all.must_equal [{:b=>true, :i=>1}]
end
- specify "should return all smallints as integers when unset" do
+ it "should return all smallints as integers when unset" do
@ds.convert_smallint_to_bool = false
@ds.delete
@ds << {:b=>true, :i=>10}
- @ds.all.should == [{:b=>1, :i=>10}]
+ @ds.all.must_equal [{:b=>1, :i=>10}]
@ds.delete
@ds << {:b=>false, :i=>0}
- @ds.all.should == [{:b=>0, :i=>0}]
+ @ds.all.must_equal [{:b=>0, :i=>0}]
@ds.delete
@ds << {:b=>1, :i=>10}
- @ds.all.should == [{:b=>1, :i=>10}]
+ @ds.all.must_equal [{:b=>1, :i=>10}]
@ds.delete
@ds << {:b=>0, :i=>0}
- @ds.all.should == [{:b=>0, :i=>0}]
+ @ds.all.must_equal [{:b=>0, :i=>0}]
end
end
end