Sha256: bfb9ed7e292f0a40e9b761f222191eea31d6e2d2f13482ccac785835de4ae9a1

Contents?: true

Size: 597 Bytes

Versions: 8

Compression:

Stored size: 597 Bytes

Contents

require "spec_helper"

describe Wrapper do

  before(:each) do
    @name = "app"
    @script = 'module.exports = function() {return console.log("log from app!");};'
    @expected_script = 'window.require.define({"app":' +
      'function(exports, require, module){' +
      'module.exports = function() {' +
      'return console.log("log from app!");' +
      '};' +
      ";}});\n"
  end

  it "should wrapped by wrapper" do
    script = Wrapper.wrap(@name, @script)
    script.should eq @expected_script
  end

  it "should has definition" do
    Wrapper.definition.should_not be_nil
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
linner-0.4.4 spec/linner/wrapper_spec.rb
linner-0.4.3 spec/linner/wrapper_spec.rb
linner-0.4.2 spec/linner/wrapper_spec.rb
linner-0.4.1 spec/linner/wrapper_spec.rb
linner-0.4.0 spec/linner/wrapper_spec.rb
linner-0.3.2 spec/linner/wrapper_spec.rb
linner-0.3.1 spec/linner/wrapper_spec.rb
linner-0.3.0 spec/linner/wrapper_spec.rb