Skip to content

Commit

Permalink
Generated method should have underscores.
Browse files Browse the repository at this point in the history
  • Loading branch information
bret committed Apr 9, 2009
1 parent 0cb4dbc commit 235f6f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions app_generators/watircraft/watircraft_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def manifest
lib/init
lib/pages
lib/steps
lib/methods
test
test/specs
test/features
Expand Down
14 changes: 10 additions & 4 deletions spec/method_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
include Helpers::Taza

before :each do
generate_project
generate_project ["--site=frito"]
end

after :each do
bare_teardown
end

it "should be able to generate a method" do
run_generator('spec', ['empty_shopping_cart'], generator_sources)
run_generator('method', ['empty_shopping_cart'], generator_sources)
end

end

it "should work when when the provided name includes a space" do
MethodGenerator.any_instance.stubs(:configured_site).returns('frito')
generator = MethodGenerator.new(['check out'])
generator.name.should == 'check_out'
end

end
2 changes: 1 addition & 1 deletion watircraft_generators/method/method_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MethodGenerator < RubiGen::Base
def initialize(runtime_args, runtime_options = {})
super
usage if args.empty?
@name = args.shift
@name = args.shift.computerize
@site_name = configured_validated_site
extract_options
end
Expand Down

0 comments on commit 235f6f4

Please sign in to comment.