Sha256: 700562c5cad16058fff5a53005eb175f8951bf89823a3aacd360c8aa74884b10

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

################################################
# © Alexander Semyonov, 2011—2013, MIT License #
# Author: Alexander Semyonov <al@semyonov.us>  #
################################################

require 'spec_helper'

describe Xommelier::Xml::Element::Structure do
  subject { NamespacedModule::RootWithSimpleSubelement }

  it { is_expected.to respond_to(:elements) }
  it { is_expected.to respond_to(:element) }
  it 'defines subelement' do
    expect(NamespacedModule::RootWithSimpleSubelement.elements).to have_key(:some)
  end

  it { is_expected.to respond_to(:attributes) }
  it { is_expected.to respond_to(:attribute) }
  it 'defines attribute' do
    expect(NamespacedModule::RootWithAttribute.attributes).to have_key(:another)
  end

  it { is_expected.to respond_to(:text) }
  it 'defines as containing text' do
    expect(NamespacedModule::RootWithText.new).to respond_to(:text)
  end

  it { is_expected.to respond_to(:xmlns) }
  it { expect(NamespacedModule::RootWithText.xmlns.uri).to eq('http://example.org/') }
  it { expect(NamespacedModule::RootWithAttribute.xmlns.uri).to eq('http://example.org/') }
  it { expect(Xommelier::Atom::Feed.xmlns.uri).to eq('http://www.w3.org/2005/Atom') }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xommelier-0.1.35 spec/lib/xommelier/xml/element/structure_spec.rb