Sha256: cdd60e21fb785aa4b20bb2d0ae566db1eb1e9d21b3481289386c64a3704c75d9

Contents?: true

Size: 749 Bytes

Versions: 22

Compression:

Stored size: 749 Bytes

Contents

require "minitest_helper"

module Hermod
  describe XmlSection do

    YesXml = XmlSection.build do |builder|
      builder.yes_node :awesome
    end

    describe "Yes Only Nodes" do
      describe "when true" do
        subject do
          YesXml.new do |yes_xml|
            yes_xml.awesome true
          end
        end

        it "should include the node with yes as the contents" do
          value_of_node("Awesome").must_equal "yes"
        end
      end

      describe "when not true" do
        subject do
          YesXml.new do |yes_xml|
            yes_xml.awesome false
          end
        end

        it "should not include the node" do
          number_of_nodes("Awesome").must_equal 0
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
hermod-2.6.2 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.6.1 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.5.3 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.5.2 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.5.1 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.5.0 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.4.1 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.4.0 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.2.0 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-2.1.0 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.9 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.8 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.7 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.6 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.5 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.4 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.3 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.2 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.1 spec/hermod/xml_section_builder/yes_node_spec.rb
hermod-1.2.0 spec/hermod/xml_section_builder/yes_node_spec.rb