Sha256: c5217a87a306ad2866a102a2b961e3ad1bca11155ca388610ef77f06c65dae4c

Contents?: true

Size: 1.22 KB

Versions: 10

Compression:

Stored size: 1.22 KB

Contents

require 'wml_spec_helper'

describe Weskit::WML::Attribute do
  include WMLHelpers

  let(:attribute) { Weskit::WML::Attribute.new :foo, :bar }

  it 'should change code to false when setting translatable to true' do
    attribute.should_not be_code
    attribute.should_not be_translatable

    attribute.code = true
    
    attribute.should be_code
    attribute.should_not be_translatable
    
    attribute.translatable = true

    attribute.should_not be_code
    attribute.should be_translatable
  end

  it 'should change translatable to false when setting code to true' do
    attribute.should_not be_code
    attribute.should_not be_translatable

    attribute.translatable = true
    
    attribute.should_not be_code
    attribute.should be_translatable
    
    attribute.code = true

    attribute.should be_code
    attribute.should_not be_translatable
  end

  it 'should respond to predicates' do
    attr1 = attribute.dup.merge :code => true
    attr2 = attribute.dup.merge :translatable => true
    attr3 = Weskit::WML::Attribute.new :bar, "baz \n bat"

    attr1.should be_code
    attr2.should be_translatable
    attr3.should be_multiline

    attr1.should be_text
    attr2.should be_text
    attr3.should be_text
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
weskit-0.3.6 spec/wml/attribute_spec.rb
weskit-0.3.5 spec/wml/attribute_spec.rb
weskit-0.3.4 spec/wml/attribute_spec.rb
weskit-0.3.3 spec/wml/attribute_spec.rb
weskit-0.3.2 spec/wml/attribute_spec.rb
weskit-0.3.1 spec/wml/attribute_spec.rb
weskit-0.3.0 spec/wml/attribute_spec.rb
weskit-0.2.1 spec/wml/attribute_spec.rb
weskit-0.2.0 spec/wml/attribute_spec.rb
weskit-0.1.0 spec/wml/attribute_spec.rb