File: matchers.rb

package info (click to toggle)
ruby-json-spec 1.1.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: ruby: 1,059; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "json_spec/matchers/be_json_eql"
require "json_spec/matchers/include_json"
require "json_spec/matchers/have_json_path"
require "json_spec/matchers/have_json_type"
require "json_spec/matchers/have_json_size"

module JsonSpec
  module Matchers
    def be_json_eql(json = nil)
      JsonSpec::Matchers::BeJsonEql.new(json)
    end

    def include_json(json = nil)
      JsonSpec::Matchers::IncludeJson.new(json)
    end

    def have_json_path(path)
      JsonSpec::Matchers::HaveJsonPath.new(path)
    end

    def have_json_type(type)
      JsonSpec::Matchers::HaveJsonType.new(type)
    end

    def have_json_size(size)
      JsonSpec::Matchers::HaveJsonSize.new(size)
    end
  end
end

RSpec.configure do |config|
  config.include JsonSpec::Matchers
end