Skip to content

Commit

Permalink
rubocop: Fix Style/HashSyntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Feb 17, 2023
1 parent 7cd5071 commit bcccbad
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ source 'https://rubygems.org'
gemspec

group :release do
gem 'github_changelog_generator', require: false
gem 'github_changelog_generator', :require => false
end

group :coverage, optional: ENV['COVERAGE']!='yes' do
group :coverage, :optional => ENV['COVERAGE']!='yes' do
gem 'simplecov-console', :require => false
gem 'codecov', :require => false
end
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Rake::TestTask.new do |t|
t.test_files = FileList.new('test/*_test.rb')
end

task update: [:update_common_tests, :update_meta_schemas]
task :update => [:update_common_tests, :update_meta_schemas]

require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop) do |task|
Expand Down
4 changes: 2 additions & 2 deletions test/full_validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_full_validation_with_instantiated_validator
}
}

validator = JSON::Validator.new(schema, { record_errors: true })
validator = JSON::Validator.new(schema, { :record_errors => true })
assert(validator.validate(data).empty?)
assert(validator.validate(data).empty?)
assert(validator.validate(data).empty?)
Expand All @@ -62,7 +62,7 @@ def test_full_validation_with_instantiated_validator
}
}

validator = JSON::Validator.new(schema, { record_errors: true })
validator = JSON::Validator.new(schema, { :record_errors => true })
assert(validator.validate(data).length == 2)
assert(validator.validate(data).length == 2)
assert(validator.validate(data).length == 2)
Expand Down
2 changes: 1 addition & 1 deletion test/list_option_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_list_option_reusing_schemas
JSON::Validator.add_schema(schema)

data = {"a" => 1}
assert_valid uri.to_s, data, clear_cache: false
assert_valid uri.to_s, data, :clear_cache => false

data = [{"a" => 1}]
assert_valid uri.to_s, data, :list => true
Expand Down
46 changes: 23 additions & 23 deletions test/uri_util_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,59 @@ def teardown

def test_normalized_uri
str = "https://www.google.com/search"
uri = Addressable::URI.new(scheme: 'https',
host: 'www.google.com',
path: 'search')
uri = Addressable::URI.new(:scheme => 'https',
:host => 'www.google.com',
:path => 'search')
assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home')
end

def test_normalized_uri_with_empty_fragment
str = "https://www.google.com/search#"
uri = Addressable::URI.new(scheme: 'https',
host: 'www.google.com',
path: 'search',
fragment: nil)
uri = Addressable::URI.new(:scheme => 'https',
:host => 'www.google.com',
:path => 'search',
:fragment => nil)
assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home')
end

def test_normalized_uri_with_fragment
str = "https://www.google.com/search#foo"
uri = Addressable::URI.new(scheme: 'https',
host: 'www.google.com',
path: 'search',
fragment: 'foo')
uri = Addressable::URI.new(:scheme => 'https',
:host => 'www.google.com',
:path => 'search',
:fragment => 'foo')
assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home')
end

def test_normalized_uri_for_absolute_path
str = "/foo/bar.json"
uri = Addressable::URI.new(scheme: 'file',
host: '',
path: '/foo/bar.json')
uri = Addressable::URI.new(:scheme => 'file',
:host => '',
:path => '/foo/bar.json')
assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home')
end

def test_normalized_uri_for_relative_path
str = "foo/bar.json"
uri = Addressable::URI.new(scheme: 'file',
host: '',
path: '/home/foo/bar.json')
uri = Addressable::URI.new(:scheme => 'file',
:host => '',
:path => '/home/foo/bar.json')
assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home')
end

def test_normalized_uri_for_file_path_with_host
str = "file://localhost/foo/bar.json"
uri = Addressable::URI.new(scheme: 'file',
host: 'localhost',
path: '/foo/bar.json')
uri = Addressable::URI.new(:scheme => 'file',
:host => 'localhost',
:path => '/foo/bar.json')
assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home')
end

def test_uri_parse
str = "https://www.google.com/search"
uri = Addressable::URI.new(scheme: 'https',
host: 'www.google.com',
path: 'search')
uri = Addressable::URI.new(:scheme => 'https',
:host => 'www.google.com',
:path => 'search')
assert_equal uri, JSON::Util::URI.parse(str)
end

Expand Down

0 comments on commit bcccbad

Please sign in to comment.