exceptionist 0.1.0 → 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.
data/README.markdown ADDED
@@ -0,0 +1,39 @@
1
+ # Exceptionist - Force your application to crash #
2
+
3
+ Want to force your `Rails 3` application to respond with a certain HTTP status code? Just call
4
+
5
+ /fire/500
6
+
7
+ to let the application crash, or call
8
+
9
+ /fire/412
10
+
11
+ for a nice'n'nifty *precondition failed*.
12
+
13
+ ## Installation ##
14
+
15
+ Simply install via
16
+
17
+ $ gem install exceptionist
18
+
19
+ or when using [Bundler](http://gembundler.com/), add the line
20
+
21
+ $ gem 'exceptionist'
22
+
23
+ to your Gemfile.
24
+
25
+ ---
26
+
27
+ ## Note on Patches/Pull Requests ##
28
+
29
+ * Fork the project.
30
+ * Make your feature addition or bug fix.
31
+ * Add tests for it. This is important so I don't break it in a
32
+ future version unintentionally.
33
+ * Commit, do not mess with rakefile, version, or history.
34
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
35
+ * Send me a pull request. Bonus points for topic branches.
36
+
37
+ ## Copyright ##
38
+
39
+ Copyright (c) 2010 [Thorsten Böttger](http://mt7.de). See LICENSE for details.
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ end
21
21
  require 'rake/testtask'
22
22
  Rake::TestTask.new(:test) do |test|
23
23
  test.libs << 'lib' << 'test'
24
- test.pattern = 'test/**/test_*.rb'
24
+ test.pattern = 'test/**/*_test.rb'
25
25
  test.verbose = true
26
26
  end
27
27
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -1,6 +1,6 @@
1
1
  module Exceptionist
2
2
 
3
- class FireController < ApplicationController
3
+ class FireController < ActionController::Base
4
4
 
5
5
  def fire
6
6
  case params[:http_status_code].to_i
data/exceptionist.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{exceptionist}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["alto"]
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
14
14
  s.email = %q{boettger@mt7.de}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.markdown"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
21
  ".gitignore",
22
22
  "LICENSE",
23
- "README.rdoc",
23
+ "README.markdown",
24
24
  "Rakefile",
25
25
  "VERSION",
26
26
  "app/controllers/exceptionist/fire_controller.rb",
@@ -28,8 +28,8 @@ Gem::Specification.new do |s|
28
28
  "exceptionist.gemspec",
29
29
  "lib/exceptionist.rb",
30
30
  "lib/exceptionist/engine.rb",
31
- "test/helper.rb",
32
- "test/test_exceptionist.rb"
31
+ "test/fire_controller_test.rb",
32
+ "test/helper.rb"
33
33
  ]
34
34
  s.homepage = %q{http://github.com/alto/exceptionist}
35
35
  s.rdoc_options = ["--charset=UTF-8"]
@@ -37,8 +37,8 @@ Gem::Specification.new do |s|
37
37
  s.rubygems_version = %q{1.3.7}
38
38
  s.summary = %q{Ask Rails application to crash}
39
39
  s.test_files = [
40
- "test/helper.rb",
41
- "test/test_exceptionist.rb"
40
+ "test/fire_controller_test.rb",
41
+ "test/helper.rb"
42
42
  ]
43
43
 
44
44
  if s.respond_to? :specification_version then
@@ -0,0 +1,28 @@
1
+ require 'helper'
2
+ require 'active_support'
3
+ require "action_controller"
4
+
5
+ require 'controllers/exceptionist/fire_controller'
6
+
7
+ class FireControllerTest < ActionController::TestCase
8
+ tests Exceptionist::FireController
9
+
10
+ setup do
11
+ @routes = ActionDispatch::Routing::RouteSet.new.tap { |r| r.draw { match ':controller(/:action(/:id(.:format)))' } }
12
+ @controller.class.send :include, @routes.url_helpers
13
+ end
14
+
15
+ should "probably rename this file and start testing for real" do
16
+ assert_raises RuntimeError do
17
+ get :fire, :http_status_code => "500"
18
+ end
19
+ end
20
+
21
+ should "return the provided http status code" do
22
+ assert_nothing_raised do
23
+ get :fire, :http_status_code => "412"
24
+ end
25
+ assert_response 412
26
+ end
27
+
28
+ end
data/test/helper.rb CHANGED
@@ -2,9 +2,5 @@ require 'rubygems'
2
2
  require 'test/unit'
3
3
  require 'shoulda'
4
4
 
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'app'))
6
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
7
- require 'exceptionist'
8
-
9
- class Test::Unit::TestCase
10
- end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptionist
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - alto
@@ -40,12 +40,12 @@ extensions: []
40
40
 
41
41
  extra_rdoc_files:
42
42
  - LICENSE
43
- - README.rdoc
43
+ - README.markdown
44
44
  files:
45
45
  - .document
46
46
  - .gitignore
47
47
  - LICENSE
48
- - README.rdoc
48
+ - README.markdown
49
49
  - Rakefile
50
50
  - VERSION
51
51
  - app/controllers/exceptionist/fire_controller.rb
@@ -53,8 +53,8 @@ files:
53
53
  - exceptionist.gemspec
54
54
  - lib/exceptionist.rb
55
55
  - lib/exceptionist/engine.rb
56
+ - test/fire_controller_test.rb
56
57
  - test/helper.rb
57
- - test/test_exceptionist.rb
58
58
  has_rdoc: true
59
59
  homepage: http://github.com/alto/exceptionist
60
60
  licenses: []
@@ -90,5 +90,5 @@ signing_key:
90
90
  specification_version: 3
91
91
  summary: Ask Rails application to crash
92
92
  test_files:
93
+ - test/fire_controller_test.rb
93
94
  - test/helper.rb
94
- - test/test_exceptionist.rb
data/README.rdoc DELETED
@@ -1,17 +0,0 @@
1
- = exceptionist
2
-
3
- Description goes here.
4
-
5
- == Note on Patches/Pull Requests
6
-
7
- * Fork the project.
8
- * Make your feature addition or bug fix.
9
- * Add tests for it. This is important so I don't break it in a
10
- future version unintentionally.
11
- * Commit, do not mess with rakefile, version, or history.
12
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
- * Send me a pull request. Bonus points for topic branches.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2010 Thorsten Böttger. See LICENSE for details.
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestExceptionist < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end