lilypad 0.1.9 → 0.2.0

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.
@@ -2,7 +2,7 @@ class SinatraApp < Sinatra::Base
2
2
 
3
3
  use Rack::Lilypad, 'xxx'
4
4
 
5
- get "/raise" do
5
+ get "/pulse" do
6
6
  raise TestError, 'Test'
7
7
  end
8
8
  end
@@ -3,15 +3,11 @@ require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
3
3
  describe Rack::Lilypad do
4
4
 
5
5
  include Rack::Test::Methods
6
-
7
- def app
8
- SinatraApp.new
9
- end
10
6
 
11
7
  before(:each) do
12
8
  ENV['RACK_ENV'] = 'production'
13
9
  @app = lambda { |env| raise TestError, 'Test' }
14
- @env = Rack::MockRequest.env_for("/raise")
10
+ @env = Rack::MockRequest.env_for("/pulse")
15
11
  @http = mock(:http)
16
12
  @http.stub!(:read_timeout=)
17
13
  @http.stub!(:open_timeout=)
@@ -49,15 +45,6 @@ describe Rack::Lilypad do
49
45
  File.delete(log)
50
46
  end
51
47
 
52
- it "should post an error to Hoptoad" do
53
- @http.should_receive(:post)
54
- get "/raise" rescue nil
55
- end
56
-
57
- it "should re-raise the exception" do
58
- lambda { get "/raise" }.should raise_error(TestError)
59
- end
60
-
61
48
  it "should transfer valid XML to Hoptoad" do
62
49
  # Test complex environment variables
63
50
  @env['rack.hash_test'] = { :test => true }
@@ -77,9 +64,47 @@ describe Rack::Lilypad do
77
64
  errors.length.should == 0
78
65
  end
79
66
 
80
- it "should not do anything if non-production environment" do
81
- ENV['RACK_ENV'] = 'development'
82
- @http.should_not_receive(:post)
83
- get "/raise" rescue nil
67
+ describe 'Rails' do
68
+
69
+ def app
70
+ ActionController::Dispatcher.new
71
+ end
72
+
73
+ it "should post an error to Hoptoad" do
74
+ @http.should_receive(:post)
75
+ get "/pulse" rescue nil
76
+ end
77
+
78
+ it "should re-raise the exception" do
79
+ lambda { get "/pulse" }.should raise_error(TestError)
80
+ end
81
+
82
+ it "should not do anything if non-production environment" do
83
+ ENV['RACK_ENV'] = 'development'
84
+ @http.should_not_receive(:post)
85
+ get "/pulse" rescue nil
86
+ end
87
+ end
88
+
89
+ describe 'Sinatra' do
90
+
91
+ def app
92
+ SinatraApp.new
93
+ end
94
+
95
+ it "should post an error to Hoptoad" do
96
+ @http.should_receive(:post)
97
+ get "/pulse" rescue nil
98
+ end
99
+
100
+ it "should re-raise the exception" do
101
+ lambda { get "/pulse" }.should raise_error(TestError)
102
+ end
103
+
104
+ it "should not do anything if non-production environment" do
105
+ ENV['RACK_ENV'] = 'development'
106
+ @http.should_not_receive(:post)
107
+ get "/pulse" rescue nil
108
+ end
84
109
  end
85
110
  end
data/spec/spec_helper.rb CHANGED
@@ -10,6 +10,7 @@ require 'nokogiri'
10
10
  require 'rack/test'
11
11
  require 'sinatra/base'
12
12
 
13
+ require File.expand_path("#{SPEC}/fixtures/rails/config/environment")
13
14
  require File.expand_path("#{SPEC}/fixtures/sinatra")
14
15
 
15
16
  Spec::Runner.configure do |config|
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.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winton Welsh
@@ -11,8 +11,17 @@ cert_chain: []
11
11
 
12
12
  date: 2009-12-02 00:00:00 -08:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: builder
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.1.2
24
+ version:
16
25
  description:
17
26
  email: mail@wintoni.us
18
27
  executables: []
@@ -28,6 +37,21 @@ files:
28
37
  - Rakefile
29
38
  - README.markdown
30
39
  - spec/fixtures/hoptoad_2_0.xsd
40
+ - spec/fixtures/rails/app/controllers/application_controller.rb
41
+ - spec/fixtures/rails/app/helpers/application_helper.rb
42
+ - spec/fixtures/rails/config/boot.rb
43
+ - spec/fixtures/rails/config/environment.rb
44
+ - spec/fixtures/rails/config/environments/development.rb
45
+ - spec/fixtures/rails/config/environments/production.rb
46
+ - spec/fixtures/rails/config/environments/test.rb
47
+ - spec/fixtures/rails/config/initializers/backtrace_silencers.rb
48
+ - spec/fixtures/rails/config/initializers/inflections.rb
49
+ - spec/fixtures/rails/config/initializers/mime_types.rb
50
+ - spec/fixtures/rails/config/initializers/new_rails_defaults.rb
51
+ - spec/fixtures/rails/config/initializers/session_store.rb
52
+ - spec/fixtures/rails/config/locales/en.yml
53
+ - spec/fixtures/rails/config/routes.rb
54
+ - spec/fixtures/rails/log/development.log
31
55
  - spec/fixtures/sinatra.rb
32
56
  - spec/rack/lilypad_spec.rb
33
57
  - spec/spec.opts