Sha256: 23f5ee9babf57027ea62a30e4594f1baab4244dd5883356bba5292e7a37d2576

Contents?: true

Size: 1.34 KB

Versions: 24

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe "use the root element as a member of the proxy address" do
  before(:all) do
    class BlahTerminology
      include OM::XML::Document

      set_terminology do |t|
        t.root :path => 'root_element', :xmlns => "asdf"
        t.relevant_container do
          t.the_thing_we_want
        end

        t.the_thing_we_want :proxy => [:root_element, :relevant_container, :the_thing_we_want]
      end
    end
  end

  subject do
    BlahTerminology.from_xml('<root_element xmlns="asdf">
                                <arbitrary_container_element>
                                  <relevant_container>
                                    <the_thing_we_want but="not really">1</the_thing_we_want>
                                  </relevant_container>
                                </arbitrary_container_element>
                                <relevant_container>
                                  <the_thing_we_want>2</the_thing_we_want>
                                </relevant_container>
                              </root_element>')
  end

  it "should pull out all occurences of the_thing_we_want in the relevant_container" do
    subject.relevant_container.the_thing_we_want.should == ["1", "2"]
  end

  it "should only pull out the_thing_we_want at the root level" do
    subject.the_thing_we_want.should == ["2"]
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
om-3.1.0 spec/integration/differentiated_elements_spec.rb
om-3.0.7 spec/integration/differentiated_elements_spec.rb
om-3.0.6 spec/integration/differentiated_elements_spec.rb
om-3.0.5 spec/integration/differentiated_elements_spec.rb
om-3.0.4 spec/integration/differentiated_elements_spec.rb
om-3.0.3 spec/integration/differentiated_elements_spec.rb
om-3.0.2 spec/integration/differentiated_elements_spec.rb
om-3.0.1 spec/integration/differentiated_elements_spec.rb
om-3.0.0 spec/integration/differentiated_elements_spec.rb
om-2.2.1 spec/integration/differentiated_elements_spec.rb
om-3.0.0.beta2 spec/integration/differentiated_elements_spec.rb
om-3.0.0.beta1 spec/integration/differentiated_elements_spec.rb
om-2.1.2 spec/integration/differentiated_elements_spec.rb
om-2.1.1 spec/integration/differentiated_elements_spec.rb
om-2.1.0 spec/integration/differentiated_elements_spec.rb
om-2.0.0 spec/integration/differentiated_elements_spec.rb
om-1.9.0.rc1 spec/integration/differentiated_elements_spec.rb
om-1.9.0.pre1 spec/integration/differentiated_elements_spec.rb
om-1.8.0 spec/integration/differentiated_elements_spec.rb
om-1.8.0.rc1 spec/integration/differentiated_elements_spec.rb