Sha256: fca9264ef1ceb4e0f0b06d87d50c38f948e838e205111927eaa7b7fbe2754a01

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

require "assert"
require 'xmlss/style/base'

module Xmlss::Style

  class BaseTest < Assert::Context
    desc "Xmlss::Style::Base"
    before { @bs = Base.new(:test) }
    subject { @bs }

    should have_class_method :writer
    should have_reader :id

    should "know its writer" do
      assert_equal :style, subject.class.writer
    end

    should "bark if you don't init with an id" do
      assert_raises ArgumentError do
        Base.new(nil)
      end
    end

    should "force string ids" do
      assert_equal 'string', Base.new('string').id
      assert_equal 'symbol', Base.new(:symbol).id
      assert_equal '123', Base.new(123).id
    end

    should "set it's defaults" do
      assert_equal 'test', subject.id
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xmlss-1.0.0.rc.4 test/style/base_test.rb
xmlss-1.0.0.rc.3 test/style/base_test.rb
xmlss-1.0.0.rc.2 test/style/base_test.rb