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-0.0.2 test/test_helper.rb
masterview-0.0.10 test/test_helper.rb
masterview-0.0.11 test/test_helper.rb
masterview-0.0.12 test/test_helper.rb
masterview-0.0.13 test/test_helper.rb
masterview-0.0.14 test/test_helper.rb
masterview-0.0.15 test/test_helper.rb
masterview-0.0.16 test/test_helper.rb
masterview-0.0.17 test/test_helper.rb
masterview-0.0.9 test/test_helper.rb
masterview-0.1.0 test/test_helper.rb
masterview-0.1.1 test/test_helper.rb
masterview-0.1.3 test/test_helper.rb
masterview-0.1.2 test/test_helper.rb
masterview-0.1.5 test/test_helper.rb
masterview-0.0.7 test/test_helper.rb
masterview-0.0.8 test/test_helper.rb
masterview_parser-0.0.6 test/test_helper.rb
masterview_parser-0.0.3 test/test_helper.rb
masterview_parser-0.0.4 test/test_helper.rb