Sha256: f2b21bb8b564c86def8182a6a5ea19a84da89b3a538c2e2ef4c408dd0f45796e

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Uglifier" do
  it "minifies JS" do
    source = File.read("vendor/uglifyjs/lib/parse-js.js")
    minified = Uglifier.new.compile(source)
    minified.length.should < source.length
    lambda {
      Uglifier.new.compile(minified)
    }.should_not raise_error
  end

  it "throws an exception when compilation fails" do
    lambda {
      Uglifier.new.compile(")(")
    }.should raise_error(Uglifier::Error)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uglifier-0.1.0 spec/uglifier_spec.rb