File: error_test.rb

package info (click to toggle)
ruby-brandur-json-schema 0.19.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 376 kB
  • sloc: ruby: 3,764; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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