2009-06-25 04:21:00 -04:00
|
|
|
require 'generators/generators_test_helper'
|
2010-01-18 07:44:32 -05:00
|
|
|
require 'generators/rails/metal/metal_generator'
|
2009-06-25 04:21:00 -04:00
|
|
|
|
2010-01-18 18:07:11 -05:00
|
|
|
class MetalGeneratorTest < Rails::Generators::TestCase
|
|
|
|
include GeneratorsTestHelper
|
2010-01-03 10:34:32 -05:00
|
|
|
arguments %w(foo)
|
2009-06-25 04:21:00 -04:00
|
|
|
|
|
|
|
def test_metal_skeleton_is_created
|
|
|
|
run_generator
|
|
|
|
assert_file "app/metal/foo.rb", /class Foo/
|
|
|
|
end
|
|
|
|
|
2009-06-25 05:56:18 -04:00
|
|
|
def test_check_class_collision
|
|
|
|
content = capture(:stderr){ run_generator ["object"] }
|
|
|
|
assert_match /The name 'Object' is either already used in your application or reserved/, content
|
|
|
|
end
|
2009-06-25 04:21:00 -04:00
|
|
|
end
|