Skip to content

Commit

Permalink
Assert with a non existent file using Regexp
Browse files Browse the repository at this point in the history
In the RBX and Ruby the Errno::ENOENT are different.

This patch uses a regexp this way we can handle both platforms.
  • Loading branch information
maurogeorge committed Dec 22, 2015
1 parent dec52eb commit a3fb472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/active_model_serializers/test/schema_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ def test_that_assert_with_a_custom_schema_directory
end

def test_with_a_non_existent_file
message = 'No such file or directory - No Schema file at test/support/schemas/non-existent.json'
message = %r{.* - No Schema file at test/support/schemas/non-existent.json}

get :show

error = assert_raises ActiveModelSerializers::Test::Schema::MissingSchema do
assert_response_schema('non-existent.json')
end
assert_equal(message, error.message)
assert_match(message, error.message)
end

def test_that_raises_with_a_invalid_json_body
Expand Down

0 comments on commit a3fb472

Please sign in to comment.