File: test_crass.rb

package info (click to toggle)
ruby-crass 1.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 824 kB
  • sloc: ruby: 2,158; python: 202; makefile: 7
file content (31 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# encoding: utf-8
require_relative 'support/common'

describe 'Crass' do
  make_my_diffs_pretty!
  parallelize_me!

  it 'parse_properties() should call Crass::Parser.parse_properties' do
    assert_equal(
      CP.parse_properties("a:b; c:d 42!important;\n"),
      Crass.parse_properties("a:b; c:d 42!important;\n")
    )

    assert_equal(
      CP.parse_properties(";; /**/ ; ;", :preserve_comments => true),
      Crass.parse_properties(";; /**/ ; ;", :preserve_comments => true)
    )
  end

  it 'parse() should call Crass::Parser.parse_stylesheet' do
    assert_equal(
      CP.parse_stylesheet(" /**/ .foo {} #bar {}"),
      Crass.parse(" /**/ .foo {} #bar {}")
    )

    assert_equal(
      CP.parse_stylesheet(" /**/ .foo {} #bar {}", :preserve_comments => true),
      Crass.parse(" /**/ .foo {} #bar {}", :preserve_comments => true)
    )
  end
end