Sha256: 6610d54f1ece887b7df69b742479cbd074fddd915410f3ce78e1734270bed82d

Contents?: true

Size: 1.07 KB

Versions: 13

Compression:

Stored size: 1.07 KB

Contents

# encoding: UTF-8
require 'spec_helper'

module Roadie
  describe StyleBlock do
    it "has a selector and a list of properties" do
      properties = []
      selector = double "Selector"

      block = StyleBlock.new(selector, properties)
      expect(block.selector).to eq(selector)
      expect(block.properties).to eq(properties)
    end

    it "delegates #specificity to the selector" do
      selector = double "Selector", specificity: 45
      expect(StyleBlock.new(selector, []).specificity).to eq(45)
    end

    it "delegates #inlinable? to the selector" do
      selector = double "Selector", inlinable?: "maybe"
      expect(StyleBlock.new(selector, []).inlinable?).to eq("maybe")
    end

    it "delegates #selector_string to selector#to_s" do
      selector = double "Selector", to_s: "yey"
      expect(StyleBlock.new(selector, []).selector_string).to eq("yey")
    end

    it "has a string representation" do
      properties = [double(to_s: "bar"), double(to_s: "baz")]
      expect(StyleBlock.new(double(to_s: "foo"), properties).to_s).to eq("foo{bar;baz}")
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
roadie-3.3.0 spec/lib/roadie/style_block_spec.rb
roadie-3.2.2 spec/lib/roadie/style_block_spec.rb
roadie-3.2.1 spec/lib/roadie/style_block_spec.rb
roadie-3.2.0 spec/lib/roadie/style_block_spec.rb
roadie-3.1.1 spec/lib/roadie/style_block_spec.rb
roadie-3.1.0 spec/lib/roadie/style_block_spec.rb
roadie-3.1.0.rc1 spec/lib/roadie/style_block_spec.rb
roadie-3.0.5 spec/lib/roadie/style_block_spec.rb
roadie-3.0.4 spec/lib/roadie/style_block_spec.rb
roadie-3.0.3 spec/lib/roadie/style_block_spec.rb
roadie-3.0.2 spec/lib/roadie/style_block_spec.rb
roadie-3.0.1 spec/lib/roadie/style_block_spec.rb
roadie-3.0.0 spec/lib/roadie/style_block_spec.rb