Sha256: f6cd871de0309d0020d2e9c9c38ad61f8ff419d01920b4dd2ed3d4767ed3f48a
Contents?: true
Size: 909 Bytes
Versions: 21
Compression:
Stored size: 909 Bytes
Contents
require 'test/unit' require 'test/unit/assertions' currentPath = File.dirname(__FILE__) require File.join( currentPath, '../lib/masterview' ) MasterView::OmitGeneratedComments = true #turn off the generated comments to make it easier for us to test module Test module Unit module Assertions def assert_template_result(expected, template, options={}, message=nil) output_hash = {} full_options = options.merge( { :serializer => MasterView::HashSerializer.new(output_hash) } ) MasterView::Parser.parse(template, full_options) output_hash.each do |key,value| value.gsub!( /([^=]>)\s+/, '\1' ) #remove whitespace after tag but not => value.gsub!( /(\s{2,}|\n\s*)/, ' ') #change double space or newline and spaces into single space end assert_equal expected, output_hash, message end end end end
Version data entries
21 entries across 21 versions & 2 rubygems
Version | Path |
---|---|
masterview_parser-0.0.5 | test/test_helper.rb |