Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add spec and travis support

  • Loading branch information...
commit a395c1adea3d0f54173c6d23b824609dff1e8b44 1 parent 4947409
@ConradIrwin authored
View
10 .travis.yml
@@ -0,0 +1,10 @@
+language: ruby
+rvm:
+ - 1.9.3
+ - 1.9.2
+ - jruby-18mode
+ - jruby-19mode
+ - rbx-18mode
+ - rbx-19mode
+ - 1.8.7
+ - ree
View
15 Rakefile
@@ -0,0 +1,15 @@
+
+task :compile do
+ cd 'ext/' do
+ sh 'ruby extconf.rb'
+ sh 'make'
+ end
+end
+
+task :test do
+ sh 'rspec spec -r ./spec/spec_helpers.rb'
+end
+
+task :default => [:compile, :test]
+
+
View
25 spec/interception_spec.rb
@@ -0,0 +1,25 @@
+describe Interception do
+
+ before do
+ @exceptions = []
+ Interception.listen do |e, b|
+ @exceptions << [e, b]
+ end
+ end
+
+ after do
+ Interception.listeners.each do |l|
+ Interception.unlisten l
+ end
+ end
+
+ it "should allow keeping a log of all exceptions raised" do
+ begin
+ raise "foo"
+ rescue => e
+ #
+ end
+
+ @exceptions.map(&:first).should == [e]
+ end
+end
View
1  spec/spec_helpers.rb
@@ -0,0 +1 @@
+require File.expand_path('../../lib/interception', __FILE__)
Please sign in to comment.
Something went wrong with that request. Please try again.