0
@@ -29,9 +29,9 @@ describe "DataObjects::Sqlite3::Result" do
0
lambda { command.execute_reader }.should raise_error("no such table: table_which_doesnt_exist")
0
- it "should return the affected rows and insert_id" do
0
+ it "should return the affected rows and insert_id" do
0
command = @connection.create_command("DROP TABLE users")
0
- command.execute_non_query
0
+ command.execute_non_query
rescue nil0
command = @connection.create_command("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)")
0
result = command.execute_non_query
0
command = @connection.create_command("INSERT INTO users (name) VALUES ('test')")
0
@@ -88,12 +88,12 @@ describe "DataObjects::Sqlite3::Result" do
0
- @connection.create_command("CREATE TABLE sail_boats ( id INTEGER PRIMARY KEY, name VARCHAR(50), port VARCHAR(50), notes VARCHAR(50)
)").execute_non_query
0
+ @connection.create_command("CREATE TABLE sail_boats ( id INTEGER PRIMARY KEY, name VARCHAR(50), port VARCHAR(50), notes VARCHAR(50)
, vintage BOOLEAN )").execute_non_query
0
- command = @connection.create_command("INSERT INTO sail_boats (id, name, port, name) VALUES (?, ?, ?, ?)")
0
- command.execute_non_query(1, "A", "C", "Fortune Pig!")
0
- command.execute_non_query(2, "B", "B", "Happy Cow!")
0
- command.execute_non_query(3, "C", "A", "Spoon")
0
+ command = @connection.create_command("INSERT INTO sail_boats (id, name, port, name, vintage) VALUES (?, ?, ?, ?, ?)")
0
+ command.execute_non_query(1, "A", "C", "Fortune Pig!", false)
0
+ command.execute_non_query(2, "B", "B", "Happy Cow!", true)
0
+ command.execute_non_query(3, "C", "A", "Spoon", true)
0
it "should quote a String" do
0
@@ -109,6 +109,13 @@ describe "DataObjects::Sqlite3::Result" do
0
result.to_i.should == 1
0
+ it "should handle boolean columns gracefully" do
0
+ command = @connection.create_command("INSERT INTO sail_boats (id, name, port, name, vintage) VALUES (?, ?, ?, ?, ?)")
0
+ result = command.execute_non_query(4, "Scooner", "Port au Prince", "This is one gangster boat!", true)
0
+ result.to_i.should == 1
0
it "should quote an Array" do
0
command = @connection.create_command("SELECT id, notes FROM sail_boats WHERE (id IN ?)")
0
reader = command.execute_reader([1, 2, 3])
Comments
No one has commented yet.