Module: TestXml

Defined in:
lib/test_xml.rb,
lib/test_xml/version.rb,
lib/test_xml/assertions.rb,
lib/test_xml/nokogiri/node.rb,
lib/test_xml/matcher_methods.rb

Defined Under Namespace

Modules: Assertions, MatcherMethods, NokogiriExt Classes: AssertionConfig

Constant Summary collapse

VERSION =
'0.1.6'
ASSERTIONS =
[
  AssertionConfig.new(
    :name       => :xml_contain,
    :matcher    => :contain_xml,
    :message_for_should     => lambda { |a,b| "the xml:\n#{a}\nshould contain xml:\n#{b}" },
    :message_for_should_not => lambda { |a,b| "the xml:\n#{a}\nshould not contain xml:\n#{b} but it does" }
  ),
  AssertionConfig.new(
    :name       => :xml_structure_contain,
    :matcher    => :contain_xml_structure,
    :message_for_should     => lambda { |a,b| "the xml:\n#{a}\nshould match xml structure:\n#{b}" },
    :message_for_should_not => lambda { |a,b| "the xml:\n#{a}\nshould not match xml structure:\n#{b} but it does" }
  ),
  AssertionConfig.new(
    :name       => :xml_equal,
    :matcher    => :equal_xml,
    :message_for_should     => lambda { |a,b| "the xml:\n#{a}\nshould exactly match xml:\n#{b}" },
    :message_for_should_not => lambda { |a,b| "the xml:\n#{a}\nshould not exactly match xml:\n#{b} but it does" }
  ),
  AssertionConfig.new(
    :name       => :xml_structure_equal,
    :matcher    => :equal_xml_structure,
    :message_for_should     => lambda { |a,b| "the xml:\n#{a}\nshould exactly match xml structure:\n#{b}" },
    :message_for_should_not => lambda { |a,b| "the xml:\n#{a}\nshould not exactly match xml structure:\n#{b} but it does" }
  )
]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.enable_placeholdersObject

Returns the value of attribute enable_placeholders.



9
10
11
# File 'lib/test_xml.rb', line 9

def enable_placeholders
  @enable_placeholders
end

Class Method Details

.placeholders_enabled?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/test_xml.rb', line 11

def placeholders_enabled?
  !!enable_placeholders
end