Sha256: 59615069a18f937bf78b16aa4c3b1584fbf49541dcf6f27e0406298e265a7b01

Contents?: true

Size: 855 Bytes

Versions: 1

Compression:

Stored size: 855 Bytes

Contents

require 'test_helper'

module BottleRocket
  module TagBuilders

    class TimeUnitBuilderTest < TestCase

      before do
        @time_unit = TimeUnitBuilder.new(:minutes, 1)
      end

      it 'has value' do
        assert_equal 1, @time_unit.value
      end

      it 'has unit' do
        assert_equal :minutes, @time_unit.unit
      end

      it 'has a 1 value' do
        [-1, 1].each do |n|
          time_unit = TimeUnitBuilder.new(:minutes, n)

          assert time_unit.one?
        end
      end

      it 'has no 1 value' do
        [-2, 0, 2].each do |n|
          time_unit = TimeUnitBuilder.new(:minutes, n)

          refute time_unit.one?
        end
      end

      it 'creates html' do
        assert_equal '<span class="minutes-1">1</span>', @time_unit.to_html
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bottle_rocket-0.0.1 test/bottle_rocket/tag_builders/time_unit_builder_test.rb