Skip to content

Commit 5425a63

Browse files
author
David Padilla
committed
Test the generator
1 parent f3b155a commit 5425a63

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pkg
22
Manifest
33
log
4+
tmp

test/autocomplete_generator_test.rb

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'test_helper'
2+
require 'generators/autocomplete_generator'
3+
4+
class AutocompleteGeneratorTest < Test::Unit::TestCase
5+
def setup
6+
@destination = File.join('tmp', 'test_app')
7+
@source = AutocompleteGenerator.source_root
8+
9+
AutocompleteGenerator.start('', :destination_root => @destination)
10+
end
11+
12+
def test_install
13+
assert File.exists?(
14+
File.join(@destination, 'public', 'javascripts', 'autocomplete-rails.js')
15+
)
16+
17+
assert_equal(
18+
File.read(File.join(@source, 'autocomplete-rails.js')),
19+
File.read(File.join(@destination, 'public', 'javascripts', 'autocomplete-rails.js'))
20+
)
21+
end
22+
end

0 commit comments

Comments
 (0)