Sha256: 3c26096e2a6e1e602e1eeacf6a16c27992e0b8d6663a5f9b2b1cf48ba8393d08

Contents?: true

Size: 828 Bytes

Versions: 17

Compression:

Stored size: 828 Bytes

Contents

require 'spec_helper'

# Below the helpers expected from a spec that
# includes these shared examples:
#
# @object [PathReader] path_reader the object under test
# @method [String]     path        the path we want to read
# @method [String]     contents    the contents we expect to be read
#
shared_examples :path_reader do
  describe '#paths' do
    it 'is an Enumberable' do
      expect(path_reader.paths).to be_an(Enumerable)
    end

    it 'includes Opal.paths' do
      paths = path_reader.paths.to_a
      Opal.paths.each { |path| expect(paths).to include(path) }
    end
  end

  describe '#read' do
    it 'responds to #path' do
      expect(path_reader.read(path)).to eq(contents)
    end

    it 'returns nil if the file is missing' do
      expect(path_reader.read('unexpected-path!')).to be_nil
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
opal-sprockets-0.4.9.1.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.8.1.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.7.1.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.6.1.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.5.1.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.4.1.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.3.0.11.0.3.7 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.2.0.11.0.3.1 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.2.pre.1.0.11.0.3.1 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.1.0.11.0.3.1 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.1.0.11.0.rc1.3.1 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.1.0.11.0.rc1.3.1.beta2 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.1.0.10.4.3.1.0 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.0.0.11.0.rc1.3.1.beta2 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.0.0.10.0.3.0.0 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.0.0.10.0.3.0.beta1 spec/shared/path_reader_shared.rb
opal-sprockets-0.4.0.0.11.dev.3.1.beta1 spec/shared/path_reader_shared.rb