Sha256: a6a41b2c9e722e93b531a32bfd3edfdc886e229e4597429c54b1843d78c19dd6

Contents?: true

Size: 942 Bytes

Versions: 29

Compression:

Stored size: 942 Bytes

Contents

#!/usr/bin/env ruby
extras_path = File.join File.dirname(__FILE__), 'extra'
$LOAD_PATH.unshift(extras_path) unless $LOAD_PATH.include? extras_path

require 'rubygems' unless RUBY_VERSION =~ /^(?:1.9.*)$/
require 'test/unit'
require 'test/unit/assertions'
require 'caller'
require 'breakpoint'
require 'ruby-debug'
require File.join File.dirname(__FILE__), '..', 'lib', 'liquid'


module Test

  module Unit

    module Assertions
      include Liquid

      def assert_template_result(expected, template, assigns = {}, message = nil)
        assert_equal expected, Template.parse(template).render(assigns)
      end

      def assert_template_result_matches(expected, template, assigns = {}, message = nil)
        return assert_template_result(expected, template, assigns, message) unless expected.is_a? Regexp

        assert_match expected, Template.parse(template).render(assigns)
      end
    end # Assertions

  end # Unit

end # Test

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
liquid_cms-0.3.2.0 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.2.0 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.2.1.1 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.3.1.0 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.1.0 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.13 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.10 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.9 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.12 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.11 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.10 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.8 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.9 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.7 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.6 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.8 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.5 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.7 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb
liquid_cms-0.3.0.4 lib/generators/liquid_cms/templates/vendor/plugins/liquid/test/test_helper.rb
liquid_cms-0.2.0.6 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/test/test_helper.rb