Skip to content
Browse files

Fixed -v task for bin (require file was off)

Trying to fix - options
  • Loading branch information...
1 parent 004312e commit a8f391b264e294573c158c792bc8e410591cd15f @quirkey quirkey committed
Showing with 9 additions and 2 deletions.
  1. +1 −1 app_generators/sinatra_app/sinatra_app_generator.rb
  2. +1 −1 bin/sinatra-gen
  3. +7 −0 test/test_sinatra_app_generator.rb
View
2 app_generators/sinatra_app/sinatra_app_generator.rb
@@ -18,7 +18,7 @@ def initialize(runtime_args, runtime_options = {})
def manifest
record do |m|
# Ensure appropriate folder(s) exists
- m.directory ''
+ m.directory ''
if git_init
`cd #{@destination_root} && #{git} init`
View
2 bin/sinatra-gen
@@ -4,7 +4,7 @@ require 'rubygems'
require 'rubigen'
if %w(-v --version).include? ARGV.first
- require 'sinatra-gen'
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'sinatra-gen')
puts "#{File.basename($0)} #{SinatraGen::VERSION}"
exit(0)
end
View
7 test/test_sinatra_app_generator.rb
@@ -48,6 +48,13 @@ def test_generate_app_with_tiny_option
assert_generated_file 'Rakefile'
end
+ def test_generate_app_with_t_option
+ run_generator('sinatra_app', [APP_ROOT, '-t'], sources)
+ assert_generated_file 'config.ru'
+ assert_generated_file 'app.rb'
+ assert_generated_file 'Rakefile'
+ end
+
def test_generate_app_with_init_option
run_generator('sinatra_app', [APP_ROOT, '-i'], sources)
assert_basic_paths_and_files

0 comments on commit a8f391b

Please sign in to comment.
Something went wrong with that request. Please try again.