diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/dependency_tracker_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/test/template/dependency_tracker_test.rb b/actionpack/test/template/dependency_tracker_test.rb index 5b2ec0eb2d..714e2d6b29 100644 --- a/actionpack/test/template/dependency_tracker_test.rb +++ b/actionpack/test/template/dependency_tracker_test.rb @@ -3,6 +3,7 @@ require 'action_view/dependency_tracker' class DependencyTrackerTest < ActionView::TestCase Neckbeard = Class.new + Bowtie = Class.new class NeckbeardTracker def self.call(name, template) @@ -13,8 +14,8 @@ class DependencyTrackerTest < ActionView::TestCase class FakeTemplate attr_reader :source, :handler - def initialize(source) - @source, @handler = source, Neckbeard + def initialize(source, handler = Neckbeard) + @source, @handler = source, handler end end @@ -35,4 +36,10 @@ class DependencyTrackerTest < ActionView::TestCase dependencies = tracker.find_dependencies("boo/hoo", template) assert_equal ["foo/boo/hoo"], dependencies end + + def test_returns_empty_array_if_no_tracker_is_found + template = FakeTemplate.new("boo/hoo", Bowtie) + dependencies = tracker.find_dependencies("boo/hoo", template) + assert_equal [], dependencies + end end |