Sha256: 2633bff4e27f440e0435ec6cc8b1c5da9e8c53cde9a407cb8ec3864254166300

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 Bytes

Contents

require "test_helper"

module Csscss
  describe Reporter do
    it "formats string result" do
      reporter = Reporter.new({
        [sel(".foo"), sel(".bar")] => [dec("width", "1px"), dec("border", "black")],
        [sel(%w(h1 h2)), sel(".foo"), sel(".baz")] => [dec("display", "none")],
        [sel(%w(h1 h2)), sel(".bar")] => [dec("position", "relative")]
      })

     expected =<<-EXPECTED
{.foo} and {.bar} share 2 rules
{h1, h2}, {.foo} and {.baz} share 1 rule
{h1, h2} and {.bar} share 1 rule
EXPECTED
     reporter.report.must_equal expected

     expected =<<-EXPECTED
{.foo} and {.bar} share 2 rules
  - width: 1px
  - border: black
{h1, h2}, {.foo} and {.baz} share 1 rule
  - display: none
{h1, h2} and {.bar} share 1 rule
  - position: relative
EXPECTED
     reporter.report(true).must_equal expected
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csscss-0.0.1 test/csscss/reporter_test.rb