Sha256: 30287bd31beadb6903942dd225cc8a5dcadb7f3440114b3076069c4cd49e97c9

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require "test_helper"

module Csscss::Parser
  module BorderSide
    describe self do
      include CommonParserTests

      before do
        @parser = Parser.new("top")
      end

      def trans_top(s)
        Transformer.new.apply(@parser.parse(s))
      end
      alias_method :trans, :trans_top

      def trans_bottom(s)
        Transformer.new.apply(Parser.new("bottom").parse(s))
      end

      it "converts shorthand rules to longhand" do
        trans_top("thin").must_equal([
          dec("border-top-width", "thin")
        ])

        trans_bottom("rgb(1, 2, 3)").must_equal([
          dec("border-bottom-color", "rgb(1, 2, 3)")
        ])

        trans_top("thin solid #fff").must_equal([
          dec("border-top-width", "thin"),
          dec("border-top-style", "solid"),
          dec("border-top-color", "#fff")
        ])

        trans_bottom("thin solid #fff").must_equal([
          dec("border-bottom-width", "thin"),
          dec("border-bottom-style", "solid"),
          dec("border-bottom-color", "#fff")
        ])
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
csscss-1.3.3 test/csscss/parser/border_side_test.rb
csscss-1.3.2 test/csscss/parser/border_side_test.rb
csscss-1.3.1 test/csscss/parser/border_side_test.rb
csscss-1.3.0 test/csscss/parser/border_side_test.rb
csscss-1.2.0 test/csscss/parser/border_side_test.rb
csscss-1.1.0 test/csscss/parser/border_side_test.rb
csscss-1.0.0 test/csscss/parser/border_side_test.rb
csscss-0.2.1 test/csscss/parser/border_side_test.rb
csscss-0.2.0 test/csscss/parser/border_side_test.rb
csscss-0.1.0 test/csscss/parser/border_side_test.rb