Skip to content

Commit

Permalink
Update to salsify_rubocop v0.48.0 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwp authored Apr 11, 2017
1 parent d105957 commit e005419
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 12 deletions.
3 changes: 2 additions & 1 deletion avro-builder.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8

lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'avro/builder/version'
Expand Down Expand Up @@ -28,6 +29,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'json_spec'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'salsify_rubocop', '~> 0.47.0'
spec.add_development_dependency 'salsify_rubocop', '~> 0.48.0'
spec.add_development_dependency 'overcommit'
end
8 changes: 7 additions & 1 deletion spec/avro/builder/file_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
end
end
end

let(:expected) do
{
type: :record,
Expand Down Expand Up @@ -38,6 +39,7 @@
end
end
end

let(:expected) do
{
type: :record,
Expand Down Expand Up @@ -67,6 +69,7 @@
end
end
end

it "raises an error" do
expect { schema_json }.to raise_error(/File not found/)
end
Expand All @@ -80,6 +83,7 @@
end
end
end

it "raises an error" do
expect { schema_json }.to raise_error(/Multiple matches:/)
end
Expand All @@ -93,6 +97,7 @@
end
end
end

let(:expected) do
{
type: :record,
Expand Down Expand Up @@ -130,7 +135,6 @@

context "a file with a name that ends with a builtin type" do
let(:file_path) { 'spec/avro/dsl/test/with_array.rb' }
subject(:schema_json) { Avro::Builder.build(File.read(file_path)) }
let(:expected) do
{
type: :record,
Expand All @@ -142,6 +146,8 @@
}
end

subject(:schema_json) { Avro::Builder.build(File.read(file_path)) }

it "does not match a partial file name" do
# previously this triggered an infinite loop
expect(schema_json).to be_json_eql(expected.to_json)
Expand Down
1 change: 1 addition & 0 deletions spec/avro/builder_build_dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
type_macro :string_map, map(:string)
end
end

let(:expected) do
{ type: :map, values: :string }
end
Expand Down
12 changes: 12 additions & 0 deletions spec/avro/builder_logical_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -41,6 +42,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -65,6 +67,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand Down Expand Up @@ -93,6 +96,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -118,6 +122,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -126,6 +131,7 @@ def self.with_logical_types
type: [:int, :string], logicalType: :num_or_string }]
}
end

it "raises an error" do
expect { schema_json }
.to raise_error(Avro::Builder::AttributeError,
Expand All @@ -145,6 +151,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -161,6 +168,7 @@ def self.with_logical_types
} }]
}
end

it { is_expected.to be_json_eql(expected.to_json) }
end

Expand All @@ -172,6 +180,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -181,6 +190,7 @@ def self.with_logical_types
items: { type: :int, logicalType: :date } } }]
}
end

it { is_expected.to be_json_eql(expected.to_json) }
end

Expand All @@ -192,6 +202,7 @@ def self.with_logical_types
end
end
end

let(:expected) do
{
type: :record,
Expand All @@ -201,6 +212,7 @@ def self.with_logical_types
items: { type: :long, logicalType: 'timestamp-micros' } } }]
}
end

it { is_expected.to be_json_eql(expected.to_json) }
end
end
Loading

0 comments on commit e005419

Please sign in to comment.