Sha256: 3911b6f95f8b46ad80c48290a7017a03fb17d230000810de28c5241c99be0282

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require File.expand_path('../spec_helper', __FILE__)

describe AutoprefixerRails do
  it "should process CSS for selected browsers" do
    css = DIR.join('app/app/assets/stylesheets/test.css').read
    AutoprefixerRails.compile(css, ['chrome 25']).should == PREFIXED
  end

  it "should integrate with sprockets" do
    assets = Sprockets::Environment.new
    assets.append_path(DIR.join('app/app/assets/stylesheets'))

    AutoprefixerRails.install(assets, ['chrome 25'])

    assets['test.css'].to_s.should == PREFIXED
  end

  it "should has dirs whitelist" do
    assets = Sprockets::Environment.new
    assets.append_path(DIR.join('app/'))
    dirs = [DIR.join('app/vendor')]

    AutoprefixerRails.install(assets, ['chrome 25'], :dirs => dirs)

    assets['vendor/assets/stylesheets/foreign.css'].to_s.should ==
      ".f {\n  -webkit-transition: none;\n  transition: none;\n}"
    assets['app/assets/stylesheets/test.css'].to_s.should ==
      "a { transition: all 1s }\n"
  end

  it "should inspect" do
    inspect = AutoprefixerRails.inspect(['chrome 25'])
    inspect.should =~ /Browsers:\n  Chrome 25\n\n/
    inspect.should =~ /  transition: webkit/
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
autoprefixer-rails-0.4.20130603 spec/autoprefixer_spec.rb