summaryrefslogtreecommitdiff
path: root/test/error.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2015-08-10 09:48:57 +0200
committerChristoph Helma <helma@in-silico.ch>2015-08-10 09:48:57 +0200
commit23ecfc6fa5ae4913e5cd17b7d58432d1f88d780c (patch)
tree83d78aed2b9fbaa85400be96acfa5ace56537d1c /test/error.rb
parentef76c077fd39d31fc795b842c32575f6afb9fdb2 (diff)
transfer to new git project started
Diffstat (limited to 'test/error.rb')
-rw-r--r--test/error.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/error.rb b/test/error.rb
new file mode 100644
index 0000000..7b71b22
--- /dev/null
+++ b/test/error.rb
@@ -0,0 +1,24 @@
+require_relative "setup.rb"
+
+class ErrorTest < MiniTest::Test
+
+ def test_bad_request
+ object = OpenTox::Feature.new
+ assert_raises Mongoid::Errors::DocumentNotFound do
+ response = OpenTox::Feature.find(object.id)
+ end
+ end
+
+ def test_error_methods
+ assert_raises OpenTox::ResourceNotFoundError do
+ resource_not_found_error "This is a test"
+ end
+ end
+
+ def test_exception
+ assert_raises Exception do
+ raise Exception.new "Basic Exception"
+ end
+ end
+
+end