Sha256: 621252404acabd96c28b0f4f1f9083a5cbb4d20166a063cfe2766220baf186b9
Contents?: true
Size: 585 Bytes
Versions: 11
Compression:
Stored size: 585 Bytes
Contents
module PartTestMacros def xml(part) File.read(File.join(File.dirname(__FILE__), "data", "parts", "#{part}_part.xml")).lines.map(&:strip).join end def self.included(base) attr_reader :doc base.extend ClassMethods end module ClassMethods def it_should_output_correct_xml(part: nil) it "should be able to output the correct XML" do if part.nil? part = described_class.to_s.split(/::/).last part = part.gsub(/(.)([A-Z])/, '\1_\2').downcase end expect(doc.read).to eq(xml(part)) end end end end
Version data entries
11 entries across 11 versions & 2 rubygems