Sha256: 6d454007a021aa355e737809d5f8ec81c70c86f961d2ffd7e64971d847816e13

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

require 'minitest_helper'

module SlideHero
  describe ListPoint do
    it "takes text and an animation on initialization" do
      list_point = ListPoint.new("point!", animation: nil)
      list_point.text.must_equal "point!"
      list_point.animation.must_equal nil
      list_point.animation_class.must_equal nil
    end

    describe "#animation_class" do
      it "applies fragement if animation is true" do
        list_point = ListPoint.new("foo", animation: true)
        list_point.animation_class.must_equal " class=\"fragment \""
      end

      it "only applies simple animation if value not supported" do
        list_point = ListPoint.new("foo", animation: "banana")
        list_point.animation_class.must_equal " class=\"fragment \""
      end

      it "applies extra classes for supported animations" do
        supported_animations = %w{grow shrink roll-in fade-out 
      highlight-red highlight-green highlight-blue}

        supported_animations.each do |animation|
          list_point = ListPoint.new("foo", animation: animation)
          list_point.animation_class.must_equal " class=\"fragment #{animation}\""
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
slide_hero-0.0.11 test/slide_hero/list_point_spec.rb
slide_hero-0.0.10 test/slide_hero/list_point_spec.rb
slide_hero-0.0.9 test/slide_hero/list_point_spec.rb
slide_hero-0.0.8 test/slide_hero/list_point_spec.rb
slide_hero-0.0.7 test/slide_hero/list_point_spec.rb
slide_hero-0.0.6 test/slide_hero/list_point_spec.rb
slide_hero-0.0.5 test/slide_hero/list_point_spec.rb
slide_hero-0.0.4 test/slide_hero/list_point_spec.rb
slide_hero-0.0.3 test/slide_hero/list_point_spec.rb
slide_hero-0.0.2 test/slide_hero/list_point_spec.rb