Skip to content

Commit

Permalink
Fix ruby 3.0 build
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-mannino committed Nov 16, 2024
1 parent d63bb58 commit 1acf5f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion inexact-struct-dsl-compiler.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
spec.email = ['pmannino.code@gmail.com']
spec.homepage = 'https://github.com/paul-mannino/inexact-struct-dsl-compiler'
spec.summary = 'A Tapioca DSL compiler for T::InexactStruct'
spec.description = 'A Tapioca DSL compiler that adds'
spec.description = 'A Tapioca DSL compiler that adds type-checking for T::InexactStruct\'s constructor'
spec.license = 'MIT'

spec.metadata['allowed_push_host'] = 'https://rubygems.org'
Expand Down
8 changes: 6 additions & 2 deletions spec/inexact_struct_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class Baz < T::InexactStruct
expected = Dir['./spec/fixtures/*.rbi']
actual = Dir[File.join(tmp_dir, '*.rbi')]
expect(expected.size).to eq(actual.size)
expected.zip(actual).each do |expected_example, actual_example|
expect(File.read(expected_example)).to(eq(File.read(actual_example)))
expected.zip(actual).each do |rbi_expected, rbi_actual|
expect(read_normalized(rbi_actual)).to(eq(read_normalized(rbi_expected)))
end
end

Expand All @@ -58,4 +58,8 @@ class Baz < T::InexactStruct
expect(actual.first).to match(/foo.rbi$/)
end
end

def read_normalized(path)
File.read(path).gsub(/^\s*$/, "")
end
end
3 changes: 1 addition & 2 deletions spec/support/dsl_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def self.build(requested_constants:, outpath:)
gem_dir: ::Tapioca::DEFAULT_GEM_DIR,
rbi_formatter: rbi_formatter,
app_root: '.',
halt_upon_load_error: true,
compiler_options: {}
halt_upon_load_error: true
)
end
end

0 comments on commit 1acf5f1

Please sign in to comment.