diff options
Diffstat (limited to 'test/error.rb')
-rw-r--r-- | test/error.rb | 24 |
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 |