Sha256: 1bf42a860e0b1503afbba7279c95c40e920d0949057a00b2c92aa62eafef89be

Contents?: true

Size: 1.49 KB

Versions: 4

Compression:

Stored size: 1.49 KB

Contents

# -*- encoding : utf-8 -*-

describe Card::Set::Type::Scss do
  let(:scss) { 
    %{
      $link_color: #abcdef;
      a { color: $link_color; }  
    }
  }
  let(:compressed_css) {  "a{color:#abcdef}\n" }
  let(:changed_scss) { 
    %{
      $link_color: #fedcba; 
      a { color: $link_color; }
    }
  }
  let(:compressed_changed_css) {  "a{color:#fedcba}\n" }
  before do
    @scss_card = Card[:style_functional]
  end
  
  
  it 'should highlight code in html' do
    assert_view_select @scss_card.format(:html).render_core, 'div[class=CodeRay]'
  end
  
  it 'should not highlight code in css' do
    expect(@scss_card.format(:css).render_core).not_to match(/CodeRay/)
  end
  
  it_should_behave_like "machine input"  do
    let(:create_machine_input_card) { Card.gimme! "test scss", :type => :scss, :content => scss }
    let(:create_another_machine_input_card) { Card.gimme! "more scss", :type => :scss, :content => scss }
    let(:create_machine_card)  { Card.gimme! "style with scss+*style", :type => :pointer }
    let(:card_content) do
       { in:       scss,         out:     compressed_css, 
         changed_in:   changed_scss, changed_out: compressed_changed_css }
    end
  end

  it_should_behave_like 'content machine', that_produces_css do
    let(:machine_card) {  Card.gimme! "test scss", :type => :scss, :content => scss }
    let(:card_content) do
       { in:       scss,         out:     compressed_css, 
         changed_in:   changed_scss, changed_out: compressed_changed_css }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wagn-1.14.8 mod/03_machines/spec/set/type/scss_spec.rb
wagn-1.14.7 mod/03_machines/spec/set/type/scss_spec.rb
wagn-1.14.6 mod/03_machines/spec/set/type/scss_spec.rb
wagn-1.14.5 mod/03_machines/spec/set/type/scss_spec.rb