mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Removed the tupleize shit
git-svn-id: svn://hamptoncatlin.com/haml/trunk@25 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
26360e28d3
commit
cf68e5a40c
3 changed files with 1 additions and 12 deletions
|
@ -5,13 +5,6 @@ module HAMLHelpers
|
||||||
input.gsub(/\n/, '
').gsub(/\r/, '')
|
input.gsub(/\n/, '
').gsub(/\r/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
def tupleize(first, second)
|
|
||||||
second = second.reverse
|
|
||||||
first.collect do |f|
|
|
||||||
[f, second.pop]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_and_flatten(input)
|
def find_and_flatten(input)
|
||||||
sets = input.scan(/<(textarea|code|pre)[^>]*>(.*?)<\/\1>/im)
|
sets = input.scan(/<(textarea|code|pre)[^>]*>(.*?)<\/\1>/im)
|
||||||
sets.each do |thing|
|
sets.each do |thing|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class HamlTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_renders_correctly(name)
|
def assert_renders_correctly(name)
|
||||||
tupleize(load_result(name).scan(/\n/), @base.render(name).scan(/\n/)).each do |pair|
|
load_result(name).scan(/\n/).zip(@base.render(name).scan(/\n/)).each do |pair|
|
||||||
#test each line to make sure it matches... (helps with error messages to do them seperately)
|
#test each line to make sure it matches... (helps with error messages to do them seperately)
|
||||||
assert_equal(pair.first, pair.last)
|
assert_equal(pair.first, pair.last)
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,10 +7,6 @@ require 'action_view'
|
||||||
class HamlTest < Test::Unit::TestCase
|
class HamlTest < Test::Unit::TestCase
|
||||||
include HAMLHelpers
|
include HAMLHelpers
|
||||||
|
|
||||||
def test_tupleize
|
|
||||||
assert_equal(tupleize([1,2,3], [4,5,6]), [[1,4],[2,5],[3,6]])
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_find_and_flatten
|
def test_find_and_flatten
|
||||||
assert_equal(find_and_flatten("<br/><textarea></textarea><br/>"),
|
assert_equal(find_and_flatten("<br/><textarea></textarea><br/>"),
|
||||||
"<br/><textarea></textarea><br/>")
|
"<br/><textarea></textarea><br/>")
|
||||||
|
|
Loading…
Add table
Reference in a new issue