diff --git a/test/cli/combine_test.rb b/test/cli/combine_test.rb index e9aecee..9cdefd9 100644 --- a/test/cli/combine_test.rb +++ b/test/cli/combine_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'prmd/cli/combine' class PrmdCliCombineTest < Minitest::Test diff --git a/test/cli/doc_test.rb b/test/cli/doc_test.rb index eb97daa..d250ad0 100644 --- a/test/cli/doc_test.rb +++ b/test/cli/doc_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'prmd/cli/doc' class PrmdCliDocTest < Minitest::Test diff --git a/test/cli/generate_test.rb b/test/cli/generate_test.rb index fa1f113..e40c3bf 100644 --- a/test/cli/generate_test.rb +++ b/test/cli/generate_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'prmd/cli/generate' class PrmdCliGenerateTest < Minitest::Test diff --git a/test/cli/render_test.rb b/test/cli/render_test.rb index e9fd8d2..52ddab9 100644 --- a/test/cli/render_test.rb +++ b/test/cli/render_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'prmd/cli/render' class PrmdCliRenderTest < Minitest::Test diff --git a/test/cli/verify_test.rb b/test/cli/verify_test.rb index 5199a99..eb3fa25 100644 --- a/test/cli/verify_test.rb +++ b/test/cli/verify_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'prmd/cli/verify' class PrmdCliVerifyTest < Minitest::Test diff --git a/test/commands/combine_test.rb b/test/commands/combine_test.rb index ca3287c..3e71e60 100644 --- a/test/commands/combine_test.rb +++ b/test/commands/combine_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'json_pointer' diff --git a/test/commands/init_test.rb b/test/commands/init_test.rb index 66e1b23..09294af 100644 --- a/test/commands/init_test.rb +++ b/test/commands/init_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' class PrmdInitTest < Minitest::Test def test_init diff --git a/test/commands/render_test.rb b/test/commands/render_test.rb index 8a6e949..aca6936 100644 --- a/test/commands/render_test.rb +++ b/test/commands/render_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'json_pointer' @@ -6,7 +6,7 @@ class InteragentRenderTest < Minitest::Test def test_render_for_valid_schema markdown = render - assert_match /An app in our PaaS ecosystem./, markdown + assert_match(/An app in our PaaS ecosystem./, markdown) end def test_render_for_schema_with_property_defined_with_anyOf @@ -21,15 +21,15 @@ def test_render_for_schema_with_property_defined_with_anyOf } }) markdown = render - assert_match /version.*v10\.9\.rc1/, markdown + assert_match(/version.*v10\.9\.rc1/, markdown) end def test_render_for_schema_with_property_defined_with_oneOf markdown = render - assert_match /\*\*options\/\[OPTION1\]\.type\*\*/, markdown - assert_match /\*\*options\/\[OPTION2\]\.type\*\*/, markdown + assert_match(/\*\*options\/\[OPTION1\]\.type\*\*/, markdown) + assert_match(/\*\*options\/\[OPTION2\]\.type\*\*/, markdown) end @@ -95,37 +95,37 @@ def data 'example' => 'example' }, 'option-type1' => { - 'type' => 'string', - 'example' => 'OPTION1', - 'enum' => 'OPTION1' + 'type' => 'string', + 'example' => 'OPTION1', + 'enum' => 'OPTION1' }, 'option-type2' => { - 'type' => 'string', + 'type' => 'string', 'example' => 'OPTION2', 'enum' => 'OPTION2' }, 'option1' => { 'properties' => { 'type' => { - '$ref' => '#/definitions/config-var/definitions/option-type1' + '$ref' => '#/definitions/config-var/definitions/option-type1' } } }, 'option2' => { 'properties' => { 'type' => { - '$ref' => '#/definitions/config-var/definitions/option-type2' + '$ref' => '#/definitions/config-var/definitions/option-type2' } } }, - 'options' => { + 'options' => { 'items' => { 'example'=> 'CHOICE1', 'oneOf' => [ - { + { '$ref' => '#/definitions/config-var/definitions/option1' }, - { + { '$ref' => '#/definitions/config-var/definitions/option2' } ] diff --git a/test/commands/verify_test.rb b/test/commands/verify_test.rb index 8f49691..a2edb03 100644 --- a/test/commands/verify_test.rb +++ b/test/commands/verify_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers')) +require_relative '../helpers' require 'json_pointer' diff --git a/test/core/reference_localizer_test.rb b/test/core/reference_localizer_test.rb index d14973a..6ec8eb9 100644 --- a/test/core/reference_localizer_test.rb +++ b/test/core/reference_localizer_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helpers', File.dirname(__FILE__)) +require_relative '../helpers' module Prmd class ReferenceLocalizerTest < Minitest::Test diff --git a/test/link_test.rb b/test/link_test.rb index caa0493..89f89b1 100644 --- a/test/link_test.rb +++ b/test/link_test.rb @@ -1,4 +1,5 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '.', 'helpers')) +require_relative 'helpers' + module Prmd class LinkTest < MiniTest::Test include PrmdLinkTestHelpers @@ -22,7 +23,7 @@ class LinkTest < MiniTest::Test { title: "multiple_nested_required" , optional: {"user:name" => "string"}, - required: {"user:email" => "string", + required: {"user:email" => "string", "address:street" => "string", "address:zip" => "string"} } diff --git a/test/multi_loader/common.rb b/test/multi_loader/common.rb index 3223d21..e6a02b7 100644 --- a/test/multi_loader/common.rb +++ b/test/multi_loader/common.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helpers', File.dirname(__FILE__)) +require_relative '../helpers' module PrmdLoaderTests # @abstrac diff --git a/test/multi_loader/json_test.rb b/test/multi_loader/json_test.rb index c09a54a..85e50ef 100644 --- a/test/multi_loader/json_test.rb +++ b/test/multi_loader/json_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('common', File.dirname(__FILE__)) +require_relative 'common' require 'prmd/multi_loader/json' class PrmdMultiLoaderJsonTest < Minitest::Test diff --git a/test/multi_loader/toml_test.rb b/test/multi_loader/toml_test.rb index 77ad42c..71e83b1 100644 --- a/test/multi_loader/toml_test.rb +++ b/test/multi_loader/toml_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('common', File.dirname(__FILE__)) +require_relative 'common' begin require 'prmd/multi_loader/toml' rescue LoadError diff --git a/test/multi_loader/yajl_test.rb b/test/multi_loader/yajl_test.rb index 5ba5339..a8a6529 100644 --- a/test/multi_loader/yajl_test.rb +++ b/test/multi_loader/yajl_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('common', File.dirname(__FILE__)) +require_relative 'common' begin require 'prmd/multi_loader/yajl' rescue LoadError diff --git a/test/multi_loader/yaml_test.rb b/test/multi_loader/yaml_test.rb index 43e0eaf..b848373 100644 --- a/test/multi_loader/yaml_test.rb +++ b/test/multi_loader/yaml_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('common', File.dirname(__FILE__)) +require_relative 'common' require 'prmd/multi_loader/yaml' class PrmdMultiLoaderYamlTest < Minitest::Test diff --git a/test/rake_tasks/combine_test.rb b/test/rake_tasks/combine_test.rb index ca5c023..c00c9ae 100644 --- a/test/rake_tasks/combine_test.rb +++ b/test/rake_tasks/combine_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helpers', File.dirname(__FILE__)) +require_relative '../helpers' require 'prmd/rake_tasks/combine' require 'rake' diff --git a/test/rake_tasks/doc_test.rb b/test/rake_tasks/doc_test.rb index 307b415..16ff66c 100644 --- a/test/rake_tasks/doc_test.rb +++ b/test/rake_tasks/doc_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helpers', File.dirname(__FILE__)) +require_relative '../helpers' require 'prmd/rake_tasks/doc' require 'rake' diff --git a/test/rake_tasks/verify_test.rb b/test/rake_tasks/verify_test.rb index 0e9ea90..6ab5df2 100644 --- a/test/rake_tasks/verify_test.rb +++ b/test/rake_tasks/verify_test.rb @@ -1,4 +1,4 @@ -require File.expand_path('../helpers', File.dirname(__FILE__)) +require_relative '../helpers' require 'prmd/rake_tasks/verify' require 'rake' diff --git a/test/schema_test.rb b/test/schema_test.rb index 09b68d1..34d0f1a 100644 --- a/test/schema_test.rb +++ b/test/schema_test.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.join(File.dirname(__FILE__), 'helpers')) +require_relative 'helpers' class SchemaTest < Minitest::Test def test_dereference_with_ref