Sha256: e350c0c739f6b9c6b3ee7b3ff3a9fe87e2ec82c0d032092670ebbbfb7c86a0e8

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

require 'helper'

describe BeautifulCss::Engine do

  it 'nothing to nothing' do
    assert_renders '', ''
  end



  it 'vanila style' do
    dirty = <<D
a
{ color:red }
D
    assert_renders dirty, dirty
  end





  it 'two styles' do
    dirty = <<DIRTY
a
{
  color:red;
  background-color:blue;
}
DIRTY
    clean = <<CLEAN
a
{ background-color:blue }

a
{ color:red }
CLEAN
    assert_renders dirty, clean
  end



  it 'should be alphabetical' do
    dirty = <<DIRTY
a
{ color:red }

a
{ background-color:blue }

DIRTY
    clean = <<CLEAN
a
{ background-color:blue }

a
{ color:red }
CLEAN
    assert_renders dirty, clean
  end






  it 'should be able to handle scss' do
    dirty = <<DIRTY
.classy {
  a
  { color:red }
}
DIRTY
    clean = <<CLEAN
.classy a
{ color:red }
CLEAN
    assert_renders dirty, clean
  end






  def assert_renders(dirty,clean)
    assert_equal clean.strip, convert(dirty).strip
  end

  def convert(css)
    BeautifulCss::Engine.new(css).render
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
beautiful-css-0.0.1 spec/convertions_spec.rb