spec/spec_helper.rb in ivy-serializers-0.3.0 vs spec/spec_helper.rb in ivy-serializers-0.4.0
- old
+ new
@@ -1,9 +1,11 @@
require 'simplecov'
SimpleCov.start
+require 'json-schema-rspec'
+
# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# files.
@@ -19,9 +21,16 @@
# The `.rspec` file also contains a few flags that are not defaults but that
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
+ config.include JSON::SchemaMatchers
+
+ # Load schema files into config.json_schemas.
+ Dir[File.join(File.expand_path('../schemas', __FILE__), '**', '*.json')].each do |file|
+ config.json_schemas[File.basename(file, '.json').to_sym] = file
+ end
+
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`