Sha256: 3fa1296cfff416bebb6c54fbe35c96603d78e41910718bfb930cf713909f6b64

Contents?: true

Size: 445 Bytes

Versions: 27

Compression:

Stored size: 445 Bytes

Contents

require "test_helper"

require "json_schema"

describe JsonSchema::SchemaError do
  it "can print a message with a pointer" do
    schema = JsonSchema::Schema.new
    schema.fragment = "#"

    e = JsonSchema::SchemaError.new(schema, "problem", nil)
    assert_equal "#: problem", e.to_s
  end

  it "can print a message without a pointer" do
    e = JsonSchema::SchemaError.new(nil, "problem", nil)
    assert_equal "problem", e.to_s
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
json_schema-0.21.0 test/json_schema/error_test.rb
json_schema-0.20.9 test/json_schema/error_test.rb
dato_json_schema-0.20.9 test/json_schema/error_test.rb
dato_json_schema-0.20.8 test/json_schema/error_test.rb
json_schema-0.20.8 test/json_schema/error_test.rb
json_schema-0.20.7 test/json_schema/error_test.rb
json_schema-0.20.6 test/json_schema/error_test.rb
json_schema-0.20.5 test/json_schema/error_test.rb
json_schema-0.20.4 test/json_schema/error_test.rb
json_schema-0.20.3 test/json_schema/error_test.rb
json_schema-0.20.2 test/json_schema/error_test.rb
json_schema-0.20.1 test/json_schema/error_test.rb
json_schema-0.19.1 test/json_schema/error_test.rb
json_schema-0.19.0 test/json_schema/error_test.rb
json_schema-0.18.0 test/json_schema/error_test.rb
json_schema-0.17.2 test/json_schema/error_test.rb
json_schema-0.17.1 test/json_schema/error_test.rb
json_schema-0.17.0 test/json_schema/error_test.rb
json_schema-0.16.2 test/json_schema/error_test.rb
json_schema-0.16.1 test/json_schema/error_test.rb