Sha256: f6df84a62e817370aee8a0e46875bbcef06c4a7499e90c13660b6108658912b6

Contents?: true

Size: 626 Bytes

Versions: 33

Compression:

Stored size: 626 Bytes

Contents

describe 'Kernel.require_tree' do
  it 'loads all the files in a directory' do
    $ScratchPad = []
    require_tree '../fixtures/require_tree_files'

    $ScratchPad.sort.should == ['file 1.rb', 'file 2.rb', 'file 3.rb', 'file 4.rb', 'file 5.rb',
                                'nested 1.rb', 'nested 2.rb', 'other 1.rb']
  end

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

    $ScratchPad[0].should == 'index.rb-pre'
    $ScratchPad[1...-1].sort.should == ['file 1.rb', 'file 2.rb', 'file 3.rb']
    $ScratchPad[-1].should == 'index.rb-post'
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.8.2 spec/opal/core/kernel/require_tree_spec.rb
opal-1.8.1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.8.0 spec/opal/core/kernel/require_tree_spec.rb
opal-1.8.0.beta1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.7.4 spec/opal/core/kernel/require_tree_spec.rb
opal-1.8.0.alpha1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.7.3 spec/opal/core/kernel/require_tree_spec.rb
opal-1.7.2 spec/opal/core/kernel/require_tree_spec.rb
opal-1.7.1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.7.0 spec/opal/core/kernel/require_tree_spec.rb
opal-1.7.0.rc1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.6.1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.6.0 spec/opal/core/kernel/require_tree_spec.rb
opal-1.6.0.rc1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.6.0.alpha1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.5.1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.5.0 spec/opal/core/kernel/require_tree_spec.rb
opal-1.5.0.rc1 spec/opal/core/kernel/require_tree_spec.rb
opal-1.4.1 spec/opal/core/kernel/require_tree_spec.rb