Sha256: 4d4d4fa0e347a8510ae191849df1893c3183615305140826aa013ac53bcfa284

Contents?: true

Size: 828 Bytes

Versions: 2

Compression:

Stored size: 828 Bytes

Contents

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

class Xmlss::Style::Base

  class UnitTests < Assert::Context
    desc "Xmlss::Style::Base"
    before { @bs = Xmlss::Style::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
        Xmlss::Style::Base.new(nil)
      end
    end

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

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

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xmlss-1.0.1 test/unit/style/base_tests.rb
xmlss-1.0.0 test/unit/style/base_tests.rb