Sha256: e08b7393b3c71aa702e49fad4a913a193c16fcaad3fde2af2f85b6212d908332

Contents?: true

Size: 549 Bytes

Versions: 7

Compression:

Stored size: 549 Bytes

Contents

require "spec_helper"

describe Microformat::Attribute do
  subject { Microformat::Attribute }
  
  describe "#initialize" do
    it "should accept a block of nested attributes" do
      attribute = subject.new(:name) do |attr|
        attr.attribute(:one)
        attr.attribute(:two)
        attr.attribute(:three) do |three|
          three.attribute(:four)
        end
      end
      
      expect(attribute.attributes.size).to eq(3)
    end
    
    it "should set the name" do
      expect(subject.new(:fn).name).to eq(:fn)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
elcamino-microformat-0.0.8 spec/microformat/attribute_spec.rb
microformat-0.0.7 spec/microformat/attribute_spec.rb
microformat-0.0.6 spec/microformat/attribute_spec.rb
microformat-0.0.5 spec/microformat/attribute_spec.rb
microformat-0.0.4 spec/microformat/attribute_spec.rb
microformat-0.0.3 spec/microformat/attribute_spec.rb
microformat-0.0.2 spec/microformat/attribute_spec.rb