Skip to content

Instantly share code, notes, and snippets.

@simi
Last active December 20, 2015 06:49
Show Gist options
  • Select an option

  • Save simi/6088534 to your computer and use it in GitHub Desktop.

Select an option

Save simi/6088534 to your computer and use it in GitHub Desktop.
context "Multiple results sets" do
before(:each) do
@multi_client = Mysql2::Client.new(DatabaseCredentials['root'].merge(:flags => Mysql2::Client::MULTI_STATEMENTS))
end
it "should raise an exception when one of multiple statements fails" do
@multi_client.query("SELECT 1 as 'set_1'; SELECT * FROM invalid_table_name;")
lambda {
@multi_client.next_result
}.should raise_error(Mysql2::Error)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment