Skip to content

Instantly share code, notes, and snippets.

@voidlily
Last active October 5, 2015 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voidlily/2869129 to your computer and use it in GitHub Desktop.
Save voidlily/2869129 to your computer and use it in GitHub Desktop.
source 'http://rubygems.org'
gem 'sequel'
gem 'rspec'
gem 'sqlite3'
GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.3)
rspec (2.10.0)
rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0)
rspec-mocks (~> 2.10.0)
rspec-core (2.10.1)
rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
rspec-mocks (2.10.1)
sequel (3.36.1)
sqlite3 (1.3.6)
PLATFORMS
ruby
DEPENDENCIES
rspec
sequel
sqlite3
require 'rubygems'
require 'sequel'
require 'rspec'
describe 'stack overflow spec' do
before(:all) do
DB = Sequel.sqlite
end
before(:each) do
Sequel::Dataset.any_instance.stub(:import).and_raise('db error')
end
it 'raises db error' do
expect { DB[:test].import([:a], [[1],[2],[3]]) }.to raise_error('db error')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment