Sha256: 9a310ce6d82357a1577c7db9d88a913e317b287471d011367570e05e6e546aed

Contents?: true

Size: 979 Bytes

Versions: 3

Compression:

Stored size: 979 Bytes

Contents

class GradientTestClass
  extend Compass::Core::SassExtensions::Functions::Constants
  extend Compass::Core::SassExtensions::Functions::GradientSupport::Functions
end

require 'test_helper'
require 'compass'

class GradientsTest < Test::Unit::TestCase
  
  def klass
    GradientTestClass
  end

  def sass_string(s)
    Sass::Script::String.new(s)
  end

  def sass_list(array)
    Sass::Script::List.new(array, :space)
  end

  test "should return correct angle" do
    assert_equal Sass::Script::Number.new(330, ['deg']), klass.convert_angle_from_offical(Sass::Script::Number.new(120, ['deg']))
  end

  test "Should convert old to new" do
    [:top => ['to', 'bottom'], :bottom => ['to', 'top'], :left => ['to', 'right'], :right => ['to', 'left']].each do |test_value|
      assert_equal sass_string(test_value.keys.first.to_s), klass.convert_angle_from_offical(sass_list([sass_string(test_value.values[0].first), sass_string(test_value.values[0].last)]))
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
compass-1.0.0.alpha.15 test/units/sass_extenstions/gradients_test.rb
compass-1.0.0.alpha.14 test/units/sass_extenstions/gradients_test.rb
compass-1.0.0.alpha.13 test/units/sass_extenstions/gradients_test.rb