-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'pact_broker/api/resources/base_resource' | ||
require 'pact_broker/error' | ||
|
||
module PactBroker | ||
module Api | ||
module Resources | ||
|
||
class ErrorTest < BaseResource | ||
|
||
def content_types_provided | ||
[ | ||
["application/hal+json", :to_json] | ||
] | ||
end | ||
|
||
def content_types_accepted | ||
[ | ||
["application/hal+json", :from_json] | ||
] | ||
end | ||
|
||
def allowed_methods | ||
["GET", "POST"] | ||
end | ||
|
||
def to_json | ||
raise PactBroker::Error.new("Don't panic. This is a test API error.") | ||
end | ||
|
||
def from_json | ||
raise PactBroker::Error.new("Don't panic. This is a test API error.") | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'pact_broker/ui/controllers/base_controller' | ||
require 'pact_broker/logging' | ||
require 'pact_broker/error' | ||
|
||
module PactBroker | ||
module UI | ||
module Controllers | ||
class ErrorTest < Base | ||
include PactBroker::Services | ||
include PactBroker::Logging | ||
|
||
get "/" do | ||
raise PactBroker::Error.new("Don't panic. This is a test UI error.") | ||
end | ||
end | ||
end | ||
end | ||
end |