Skip to content

Commit

Permalink
Merge pull request #293 from IceDragon200/tests-cleanup
Browse files Browse the repository at this point in the history
Cleaned up test requires
  • Loading branch information
geemus committed May 16, 2016
2 parents a998863 + 323212d commit 528dc96
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion test/cli/combine_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/cli/doc_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/cli/generate_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/cli/render_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/cli/verify_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/commands/combine_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers'))
require_relative '../helpers'

require 'json_pointer'

Expand Down
2 changes: 1 addition & 1 deletion test/commands/init_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers'))
require_relative '../helpers'

class PrmdInitTest < Minitest::Test
def test_init
Expand Down
28 changes: 14 additions & 14 deletions test/commands/render_test.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers'))
require_relative '../helpers'

require 'json_pointer'

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
Expand All @@ -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


Expand Down Expand Up @@ -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'
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/commands/verify_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helpers'))
require_relative '../helpers'

require 'json_pointer'

Expand Down
2 changes: 1 addition & 1 deletion test/core/reference_localizer_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../helpers', File.dirname(__FILE__))
require_relative '../helpers'

module Prmd
class ReferenceLocalizerTest < Minitest::Test
Expand Down
5 changes: 3 additions & 2 deletions test/link_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"}
}
Expand Down
2 changes: 1 addition & 1 deletion test/multi_loader/common.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../helpers', File.dirname(__FILE__))
require_relative '../helpers'

module PrmdLoaderTests
# @abstrac
Expand Down
2 changes: 1 addition & 1 deletion test/multi_loader/json_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('common', File.dirname(__FILE__))
require_relative 'common'
require 'prmd/multi_loader/json'

class PrmdMultiLoaderJsonTest < Minitest::Test
Expand Down
2 changes: 1 addition & 1 deletion test/multi_loader/toml_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('common', File.dirname(__FILE__))
require_relative 'common'
begin
require 'prmd/multi_loader/toml'
rescue LoadError
Expand Down
2 changes: 1 addition & 1 deletion test/multi_loader/yajl_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('common', File.dirname(__FILE__))
require_relative 'common'
begin
require 'prmd/multi_loader/yajl'
rescue LoadError
Expand Down
2 changes: 1 addition & 1 deletion test/multi_loader/yaml_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('common', File.dirname(__FILE__))
require_relative 'common'
require 'prmd/multi_loader/yaml'

class PrmdMultiLoaderYamlTest < Minitest::Test
Expand Down
2 changes: 1 addition & 1 deletion test/rake_tasks/combine_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../helpers', File.dirname(__FILE__))
require_relative '../helpers'
require 'prmd/rake_tasks/combine'
require 'rake'

Expand Down
2 changes: 1 addition & 1 deletion test/rake_tasks/doc_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../helpers', File.dirname(__FILE__))
require_relative '../helpers'
require 'prmd/rake_tasks/doc'
require 'rake'

Expand Down
2 changes: 1 addition & 1 deletion test/rake_tasks/verify_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../helpers', File.dirname(__FILE__))
require_relative '../helpers'
require 'prmd/rake_tasks/verify'
require 'rake'

Expand Down
2 changes: 1 addition & 1 deletion test/schema_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 528dc96

Please sign in to comment.