strelka-fancyerrors 0.0.1.pre.15 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- == v0.0.1 [2012-05-03] Michael Granger <ged@FaerieMUD.org>
1
+ == v0.0.1 [2012-10-17] Michael Granger <ged@FaerieMUD.org>
2
2
 
3
3
  Initial release.
4
4
 
data/Rakefile CHANGED
@@ -18,12 +18,13 @@ hoespec = Hoe.spec 'strelka-fancyerrors' do
18
18
 
19
19
  self.developer 'Michael Granger', 'ged@FaerieMUD.org'
20
20
 
21
- self.dependency 'strelka', '~> 0.0.1.pre'
22
- self.dependency 'inversion', '~> 0.9'
21
+ self.dependency 'strelka', '~> 0.0.2'
22
+ self.dependency 'inversion', '~> 0.11'
23
+ self.dependency 'loggability', '~> 0.5'
23
24
  self.dependency 'hoe-deveiate', '~> 0.1', :developer
24
25
 
25
26
  self.spec_extras[:licenses] = ["BSD"]
26
- self.spec_extras[:rdoc_options] = ['-f', 'fivefish', '-t', 'Strelka Web Application Toolkit']
27
+ self.spec_extras[:rdoc_options] = ['-f', 'fivefish', '-t', 'Strelka Fancy Error Handler']
27
28
  self.require_ruby_version( '>=1.9.2' )
28
29
  self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
29
30
  self.check_history_on_release = true if self.respond_to?( :check_history_on_release= )
@@ -9,75 +9,64 @@ BEGIN {
9
9
  }
10
10
 
11
11
  require 'rspec'
12
- require 'mongrel2/testing'
13
12
  require 'strelka'
14
13
  require 'strelka/app'
15
- require 'strelka/logging'
14
+ require 'strelka/constants'
15
+ require 'mongrel2/testing'
16
+ require 'loggability/spechelpers'
16
17
  require 'strelka/app/fancyerrors'
17
18
  require 'strelka/behavior/plugin'
18
19
 
19
20
 
20
- class ArrayLogger
21
- ### Create a new ArrayLogger that will append content to +array+.
22
- def initialize( array )
23
- @array = array
24
- end
25
-
26
- ### Write the specified +message+ to the array.
27
- def write( message )
28
- @array << message
29
- end
30
-
31
- ### No-op -- this is here just so Logger doesn't complain
32
- def close; end
21
+ ### Mock with RSpec
22
+ RSpec.configure do |c|
23
+ include Strelka::Constants
33
24
 
34
- end # class ArrayLogger
25
+ c.mock_with( :rspec )
35
26
 
27
+ c.include( Loggability::SpecHelpers )
28
+ c.include( Mongrel2::SpecHelpers )
29
+ c.include( Strelka::Constants )
30
+ end
36
31
 
37
- class FancyErrorTestingApp < Strelka::App
38
- include Strelka::Constants
39
32
 
40
- plugins :routing, :fancyerrors
33
+ describe Strelka::App::FancyErrors do
41
34
 
35
+ TEST_SEND_SPEC = 'tcp://127.0.0.1:9997'
36
+ TEST_RECV_SPEC = 'tcp://127.0.0.1:9996'
42
37
 
43
- # Set defaults for all arguments to avoid having to provide them every time
44
- def initialize( appid='fancyerrors-test', sspec=TEST_SEND_SPEC, rspec=TEST_RECV_SPEC )
45
- super
38
+ before( :all ) do
39
+ setup_logging()
46
40
  end
47
41
 
48
- get 'server' do |req|
49
- finish_with HTTP::SERVER_ERROR, "This response intentionally left blank."
50
- end
42
+ let( :request_factory ) { Mongrel2::RequestFactory.new(route: '') }
51
43
 
52
- get 'client' do |req|
53
- finish_with HTTP::BAD_REQUEST, "You call that a request?!"
54
- end
55
- end
44
+ let( :appclass ) do
45
+ Class.new( Strelka::App ) do
46
+ include Strelka::Constants
56
47
 
48
+ plugins :routing,
49
+ :fancyerrors
57
50
 
58
- describe Strelka::App::FancyErrors do
59
51
 
60
- TEST_SEND_SPEC = 'tcp://127.0.0.1:9997'
61
- TEST_RECV_SPEC = 'tcp://127.0.0.1:9996'
52
+ # Set defaults for all arguments to avoid having to provide them every time
53
+ def initialize( appid='fancyerrors-test', sspec=TEST_SEND_SPEC, rspec=TEST_RECV_SPEC )
54
+ super
55
+ end
62
56
 
63
- before( :all ) do
64
- Strelka.log.level = Logger::FATAL
65
-
66
- # Only do this when executing from a spec in TextMate
67
- if ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\.rb/)
68
- Thread.current['logger-output'] = []
69
- logdevice = ArrayLogger.new( Thread.current['logger-output'] )
70
- Strelka.logger = Logger.new( logdevice )
71
- # Strelka.logger.level = level
72
- Strelka.logger.formatter = Strelka::Logging::HtmlFormatter.new( Strelka.logger )
73
- Mongrel2.logger = Strelka.logger
74
- end
57
+ get 'server' do |req|
58
+ finish_with HTTP::SERVER_ERROR, "This response intentionally left blank."
59
+ end
75
60
 
76
- @request_factory = Mongrel2::RequestFactory.new( route: '' )
61
+ get 'client' do |req|
62
+ finish_with HTTP::BAD_REQUEST, "You call that a request?!"
63
+ end
64
+ end
77
65
  end
78
66
 
79
- before( :each ) do
80
- @app = FancyErrorTestingApp.new
67
+
68
+ after( :all ) do
69
+ reset_logging()
81
70
  end
82
71
 
83
72
 
@@ -85,26 +74,27 @@ describe Strelka::App::FancyErrors do
85
74
 
86
75
 
87
76
  it "renders server errors using the server error template" do
88
- req = @request_factory.get( '/server' )
89
- res = @app.handle( req )
77
+ req = request_factory.get( '/server' )
78
+ res = appclass.new.handle( req )
90
79
 
91
- res.body.should =~ /server error template/i
80
+ res.body.read.should =~ /server error template/i
92
81
  end
93
82
 
94
83
  it "renders client errors using the client error template" do
95
- req = @request_factory.get( '/client' )
96
- res = @app.handle( req )
84
+ req = request_factory.get( '/client' )
85
+ res = appclass.new.handle( req )
97
86
 
98
- res.body.should =~ /client error template/i
87
+ res.body.read.should =~ /client error template/i
99
88
  end
100
89
 
101
90
  it "renders errors using the existing layout template if one is set" do
102
- @app.layout = Inversion::Template.new( '<!-- common layout --><?attr body ?>' )
91
+ app = appclass.new
92
+ app.layout = Inversion::Template.new( '<!-- common layout --><?attr body ?>' )
103
93
 
104
- req = @request_factory.get( '/client' )
105
- res = @app.handle( req )
94
+ req = request_factory.get( '/client' )
95
+ res = app.handle( req )
106
96
 
107
- res.body.should =~ /common layout/i
97
+ res.body.read.should =~ /common layout/i
108
98
  end
109
99
 
110
100
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strelka-fancyerrors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.15
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
37
37
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
38
38
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2012-08-10 00:00:00.000000000 Z
39
+ date: 2012-10-18 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: strelka
@@ -45,7 +45,7 @@ dependencies:
45
45
  requirements:
46
46
  - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: 0.0.1.pre
48
+ version: 0.0.2
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  requirements:
54
54
  - - ~>
55
55
  - !ruby/object:Gem::Version
56
- version: 0.0.1.pre
56
+ version: 0.0.2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: inversion
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +61,7 @@ dependencies:
61
61
  requirements:
62
62
  - - ~>
63
63
  - !ruby/object:Gem::Version
64
- version: '0.9'
64
+ version: '0.11'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,23 @@ dependencies:
69
69
  requirements:
70
70
  - - ~>
71
71
  - !ruby/object:Gem::Version
72
- version: '0.9'
72
+ version: '0.11'
73
+ - !ruby/object:Gem::Dependency
74
+ name: loggability
75
+ requirement: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ~>
79
+ - !ruby/object:Gem::Version
80
+ version: '0.5'
81
+ type: :runtime
82
+ prerelease: false
83
+ version_requirements: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: '0.5'
73
89
  - !ruby/object:Gem::Dependency
74
90
  name: hoe-mercurial
75
91
  requirement: !ruby/object:Gem::Requirement
@@ -181,7 +197,7 @@ rdoc_options:
181
197
  - -f
182
198
  - fivefish
183
199
  - -t
184
- - Strelka Web Application Toolkit
200
+ - Strelka Fancy Error Handler
185
201
  require_paths:
186
202
  - lib
187
203
  required_ruby_version: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file