Skip to content

Commit

Permalink
Make this gem requireable
Browse files Browse the repository at this point in the history
  • Loading branch information
davebenvenuti committed Jan 15, 2025
1 parent e599e20 commit ff77682
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Empty file removed lib/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions lib/protoboeuf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

module Protoboeuf
end
29 changes: 29 additions & 0 deletions test/gem_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

require "helper"

class GemTest < ProtoBoeuf::Test
def test_can_be_required
Tempfile.create do |file|
file.write(<<~RUBY)
require "bundler/inline"
gemfile do
gem "protoboeuf", path: "#{__dir__}/..", require: true
end
::ProtoBoeuf
require "protoboeuf/codegen"
::ProtoBoeuf::CodeGen
exit 0
RUBY

file.flush

assert(system(RbConfig.ruby, "-v", file.path), "Failed to require the gem")
end
end
end

0 comments on commit ff77682

Please sign in to comment.