genspec 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
data/lib/genspec/version.rb
CHANGED
@@ -85,5 +85,16 @@ describe :test_rails3 do
|
|
85
85
|
it "should generate file 'test_arg'" do
|
86
86
|
subject.should generate('test_arg')
|
87
87
|
end
|
88
|
+
|
89
|
+
# ...and a test of nested args
|
90
|
+
with_args "template_name" do
|
91
|
+
it "should generate file 'test_arg'" do
|
92
|
+
subject.should generate('test_arg')
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should generate file 'template_name'" do
|
96
|
+
subject.should generate("template_name")
|
97
|
+
end
|
98
|
+
end
|
88
99
|
end
|
89
100
|
end
|
@@ -8,6 +8,7 @@ class TestRails3 < base
|
|
8
8
|
end
|
9
9
|
|
10
10
|
argument :argument1, :type => :string, :default => "default_file"
|
11
|
+
argument :template_name, :type => :string, :default => "file_template"
|
11
12
|
|
12
13
|
def gen_file_with_arg
|
13
14
|
create_file argument1, "content!"
|
@@ -18,7 +19,7 @@ class TestRails3 < base
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def gen_template
|
21
|
-
template 'file',
|
22
|
+
template 'file', template_name
|
22
23
|
end
|
23
24
|
|
24
25
|
def gen_gem_source
|