Sha256: c4b92c6018f2547a66d5bf8b48aee2aae2f6b2979f224ea46d486da97ae3782b

Contents?: true

Size: 765 Bytes

Versions: 40

Compression:

Stored size: 765 Bytes

Contents

require 'lib/spec_helper'
require 'opal/builder_processors'

describe Opal::Builder::RubyProcessor do
  it 'compiles ruby to js' do
    processor = described_class.new('puts 5', '-e')
    expect(processor.to_s).to include('$puts(5)')
  end

  describe ':requirable option' do
    it 'is respected' do
      processor = described_class.new('puts 5', '-e', requirable: true)
      expect(processor.to_s).to include('Opal.modules[')
    end

    it 'defaults to "false"' do
      processor = described_class.new('puts 5', '-e')
      expect(processor.to_s).not_to include('Opal.modules[')
    end
  end

  it 'fills required_trees' do
    processor = described_class.new('require_tree "./pippo"', '-e')
    expect(processor.required_trees).to eq(['pippo'])
  end
end

Version data entries

40 entries across 40 versions & 3 rubygems

Version Path
opal-0.10.6 spec/lib/builder_processors_spec.rb
opal-0.10.6.beta spec/lib/builder_processors_spec.rb
opal-0.10.5 spec/lib/builder_processors_spec.rb
opal-0.10.4 spec/lib/builder_processors_spec.rb
opal-0.11.0.rc1 spec/lib/builder_processors_spec.rb
opal-0.10.3 spec/lib/builder_processors_spec.rb
opal-0.10.2 spec/lib/builder_processors_spec.rb
opal-0.10.1 spec/lib/builder_processors_spec.rb
opal-0.10.0 spec/lib/builder_processors_spec.rb
opal-0.10.0.rc2 spec/lib/builder_processors_spec.rb
opal-0.9.4 spec/lib/builder_processors_spec.rb
opal-0.9.3 spec/lib/builder_processors_spec.rb
opal-0.10.0.rc1 spec/lib/builder_processors_spec.rb
opal-0.10.0.beta5 spec/lib/builder_processors_spec.rb
opal-0.10.0.beta4 spec/lib/builder_processors_spec.rb
opal-0.10.0.beta3 spec/lib/builder_processors_spec.rb
opal-0.10.0.beta2 spec/lib/builder_processors_spec.rb
opal-0.10.0.beta1 spec/lib/builder_processors_spec.rb
opal-0.9.2 spec/lib/builder_processors_spec.rb
opal-0.9.0 spec/lib/builder_processors_spec.rb