File: cssmin_test.rb

package info (click to toggle)
ruby-cssmin 1.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 108 kB
  • sloc: ruby: 80; makefile: 10
file content (24 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'rubygems'
require 'cssmin'

gem 'minitest'
require 'minitest/autorun'

describe CSSMin do
  subject { CSSMin.minify(css) }

  describe 'stripping comments and whitespace that are not required' do
    let(:css) { IO.read('test/fixtures/comments.css') }
    let(:expected_minified_css) { IO.read('test/fixtures/comments.css.min').strip }

    it { subject.must_equal expected_minified_css }
  end

  describe 'preserving media queries significant whitespace' do
    let(:css) { IO.read('test/fixtures/media_queries.css') }
    let(:expected_minified_css) { IO.read('test/fixtures/media_queries.css.min').strip }

    it { subject.must_equal expected_minified_css }
  end

end