lilypad 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/gemspec.rb CHANGED
@@ -13,5 +13,5 @@ GEM_SPEC = Gem::Specification.new do |s|
13
13
  s.name = GEM_NAME
14
14
  s.platform = Gem::Platform::RUBY
15
15
  s.require_path = "lib"
16
- s.version = "0.1.1"
16
+ s.version = "0.1.2"
17
17
  end
data/lib/rack/lilypad.rb CHANGED
@@ -11,6 +11,7 @@ module Rack
11
11
  @app = app
12
12
  @filters = []
13
13
  yield self if block_given?
14
+ @filters.flatten!
14
15
  @hoptoad = Hoptoad.new(api_key, @filters)
15
16
  end
16
17
 
@@ -3,6 +3,6 @@ class SinatraApp < Sinatra::Base
3
3
  use Rack::Lilypad, 'xxx'
4
4
 
5
5
  get "/raise" do
6
- raise 'Test'
6
+ raise TestError, 'Test'
7
7
  end
8
8
  end
@@ -17,11 +17,23 @@ describe Rack::Lilypad do
17
17
  Net::HTTP.stub!(:start).and_yield(@http)
18
18
  end
19
19
 
20
+ it "yields a configuration object to the block when created" do
21
+ notifier = Rack::Lilypad.new(lambda {}, '') do |app|
22
+ app.filters << %w(T1 T2)
23
+ end
24
+ notifier.filters.should include('T1')
25
+ notifier.filters.should include('T2')
26
+ end
27
+
20
28
  it "should post an error to Hoptoad" do
21
29
  @http.should_receive(:post)
22
30
  get "/raise" rescue nil
23
31
  end
24
32
 
33
+ it "should re-raise the exception" do
34
+ lambda { get "/raise" }.should raise_error(TestError)
35
+ end
36
+
25
37
  it "should transfer valid XML to Hoptoad" do
26
38
  get "/raise" rescue nil
27
39
 
data/spec/spec_helper.rb CHANGED
@@ -21,3 +21,6 @@ def debug(object)
21
21
  puts object.pretty_inspect.gsub('<', '&lt;').gsub('>', '&gt;')
22
22
  puts "</pre>"
23
23
  end
24
+
25
+ class TestError < RuntimeError
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lilypad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winton Welsh