Sha256: 591d7dd21d6b8ec35699c65c074ba67ac0d94753c89325b51fb050fa49c36baa

Contents?: true

Size: 825 Bytes

Versions: 6

Compression:

Stored size: 825 Bytes

Contents

require "test/helper"
require 'osheet/format'

module Osheet

  class FormatTest < Test::Unit::TestCase
    context "Osheet::Format" do
      subject do
        Format.new(:number, {
          :decimal_places => 4,
          :comma_separator => true,
          :negative_numbers => :black_parenth
        })
      end

      should "build format class instances" do
        assert_kind_of Format::Number, subject
        assert_equal 4, subject.decimal_places
        assert_equal true, subject.comma_separator
        assert_equal :black_parenth, subject.negative_numbers
      end

      should "error for invalid format types" do
        assert_raises ArgumentError do
          Format.new(:awesome, {})
        end
        assert_nothing_raised do
          Format.new(:general)
        end
      end

    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
osheet-0.7.0 test/format_test.rb
osheet-0.6.0 test/format_test.rb
osheet-0.5.0 test/format_test.rb
osheet-0.4.0 test/format_test.rb
osheet-0.3.0 test/format_test.rb
osheet-0.2.0 test/format_test.rb