Skip to content

Commit

Permalink
Merge pull request #1813 from opal/elia/builder-relative-path-fix
Browse files Browse the repository at this point in the history
Use relative module names in Builder#build
  • Loading branch information
elia committed May 3, 2018
2 parents f11374d + 6fdea2d commit e59c4d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/opal/builder.rb
Expand Up @@ -80,7 +80,6 @@ def self.build(*args, &block)

def build(path, options = {})
source = read(path)
path = path_reader.expand(path)
build_str(source, path, options)
end

Expand Down
6 changes: 6 additions & 0 deletions spec/lib/builder_spec.rb
Expand Up @@ -118,4 +118,10 @@
end
end
end

describe ':requirable' do
it 'it uses relative paths as module names' do
expect(builder.build('stringio', requirable: true).to_s).to include(%{Opal.modules["stringio"]})
end
end
end

0 comments on commit e59c4d0

Please sign in to comment.