Skip to content

Commit

Permalink
Showing 5 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/opal/core/fixtures/require_tree_with_dot/file 1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$ScratchPad << File.basename(__FILE__)
1 change: 1 addition & 0 deletions spec/opal/core/fixtures/require_tree_with_dot/file 2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$ScratchPad << File.basename(__FILE__)
1 change: 1 addition & 0 deletions spec/opal/core/fixtures/require_tree_with_dot/file 3.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$ScratchPad << File.basename(__FILE__)
3 changes: 3 additions & 0 deletions spec/opal/core/fixtures/require_tree_with_dot/index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ScratchPad << File.basename(__FILE__)+'pre'
require_tree '.'
$ScratchPad << File.basename(__FILE__)+'post'
9 changes: 9 additions & 0 deletions spec/opal/core/kernel/require_tree_spec.rb
Original file line number Diff line number Diff line change
@@ -6,4 +6,13 @@
$ScratchPad.sort.should == ['file 1', 'file 2', 'file 3', 'file 4', 'file 5',
'nested 1', 'nested 2', 'other 1']
end

it 'can be used with "."' do
$ScratchPad = []
require_relative '../fixtures/require_tree_with_dot/index'

$ScratchPad[0].should == 'indexpre'
$ScratchPad[1...-1].sort.should == ['file 1', 'file 2', 'file 3']
$ScratchPad[-1].should == 'indexpost'
end
end

0 comments on commit 1aa9b14

Please sign in to comment.