Skip to content

Commit

Permalink
Use relative module names in Builder#build
Browse files Browse the repository at this point in the history
fixes #1810
  • Loading branch information
elia committed May 2, 2018
1 parent f11374d commit 6fdea2d
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 6fdea2d

Please sign in to comment.