Skip to content

Instantly share code, notes, and snippets.

Created December 2, 2014 00:54
Show Gist options
  • Save anonymous/4f41a2aebec4b5fbb903 to your computer and use it in GitHub Desktop.
Save anonymous/4f41a2aebec4b5fbb903 to your computer and use it in GitHub Desktop.
commit 1b54e70da6253737ab09653e6dfaf1c0599b38ce
Merge: 179537c afd9411
Author: Ryan Davis <ryand-ruby@zenspider.com>
Date: Mon Dec 1 16:27:27 2014 -0800
WIP on test_fixes: 179537c Merge pull request #147 from mdavidn/fix_const_get
diff --cc test/autoloading_test.rb
index 6d9ca6e,6d9ca6e..a04f7b5
--- a/test/autoloading_test.rb
+++ b/test/autoloading_test.rb
@@@ -3,6 -3,6 +3,8 @@@ require_relative 'helper
module TestViews; end
class AutoloadingTest < Minitest::Test
++ # i_suck_and_my_tests_are_order_dependent!
++
def setup
Mustache.view_path = File.dirname(__FILE__) + '/fixtures'
end
@@@ -37,6 -37,6 +39,8 @@@ end_rende
end
def test_folder_autoload
++ # Mustache.view_namespace = TestViews
++ # klass = Mustache.view_class('Namespaced')
assert_equal TestViews::Namespaced, Mustache.view_class('test_views/namespaced')
end
diff --cc test/mustache_test.rb
index f80818c,f80818c..6104192
--- a/test/mustache_test.rb
+++ b/test/mustache_test.rb
@@@ -2,12 -2,12 +2,16 @@@
require_relative 'helper'
class MustacheTest < Minitest::Test
++ def simple_class
++ Class.new Simple
++ end
++
def test_instance_render
klass = Class.new(Mustache)
klass.template = "Hi {{thing}}!"
assert_equal "Hi world!", klass.render(:thing => :world)
assert_equal "Nice.", klass.render("{{compliment}}.", :compliment => "Nice")
-- assert_equal <<-end_simple, Simple.new.render(:name => "yo", :in_ca => false)
++ assert_equal <<-end_simple, simple_class.new.render(:name => "yo", :in_ca => false)
Hello yo
You have just won $10000!
end_simple
@@@ -128,7 -128,7 +132,7 @@@ rendere
end
def test_simple
-- assert_equal <<-end_simple, Simple.render
++ assert_equal <<-end_simple, simple_class.render
Hello Chris
You have just won $10000!
Well, $6000.0, after taxes.
@@@ -136,7 -136,7 +140,7 @@@ end_simpl
end
def test_hash_assignment
-- view = Simple.new
++ view = simple_class.new
view[:name] = 'Bob'
view[:value] = '4000'
view[:in_ca] = false
@@@ -148,7 -148,7 +152,7 @@@ end_simpl
end
def test_crazier_hash_assignment
-- view = Simple.new
++ view = simple_class.new
view[:name] = 'Crazy'
view[:in_ca] = [
{ :taxed_value => 1 },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment