Sha256: c34597d2e6a652c7770c9ba417533503379016ab07d18bd0bd54b0a7e62e7ee4

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

require File.join(__FILE__.gsub(/(.*)?\/spec\/.*$/, '\1'), 'spec/spec_helper')

describe Rtml::Dom::Property do
  before :each do
    @short = Rtml::Dom::Property.new(:name => 'id', :value => 'prop_test_id')
    @long1 = Rtml::Dom::Property.new(:name => 'id', :value => 'property_test_id_with_long_name')
    @long2 = Rtml::Dom::Property.new(:name => 'id', :value => 'property_test_id_with_another_long_name')
  end

  # Replace this with your real tests.
  it "should restrict length of ID properties" do
    @short.tml_value.should have(12).characters
    @long1.tml_value.should have(12).characters
    @long2.tml_value.should have(12).characters
  end

  it "should produce unique TML IDs" do
    @short.to_tml.should_not == @long1.to_tml
    @short.to_tml.should_not == @long2.to_tml
    @long1.to_tml.should_not == @long2.to_tml
  end

  it "should produce the same TML ID consistently" do
    @short.to_tml.should == @short.to_tml
    @long1.to_tml.should == @long1.to_tml
    @long2.to_tml.should == @long2.to_tml
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rtml-2.0.4 spec/models/rtml/dom/property_spec.rb
rtml-2.0.3 spec/models/rtml/dom/property_spec.rb
rtml-2.0.2 spec/models/rtml/dom/property_spec.rb
rtml-2.0.1 spec/models/rtml/dom/property_spec.rb
rtml-2.0.0.alpha.1 spec/models/rtml/dom/property_spec.rb