Permalink
Browse files

Remove duplicated tests from shared generator

[Carlos Antonio da Silva & Santiago Pastorino]
  • Loading branch information...
1 parent 858a30e commit 2b355757d5485beb42a4184e28621d86daced862 @carlosantoniodasilva carlosantoniodasilva committed with spastorino Mar 10, 2012
@@ -369,7 +369,8 @@ def test_http_only_generates_config_middleware_and_generator_http_only_setup
def test_http_only_generates_application_controller_with_action_controller_http
run_generator [destination_root, "--http-only"]
- assert_file "app/controllers/application_controller.rb", /class ApplicationController < ActionController::HTTP/
+ assert_file "app/controllers/application_controller.rb",
+ /class ApplicationController < ActionController::HTTP/
end
def test_http_only_generates_application_controller_with_protect_from_forgery_commented_out_setup
@@ -91,21 +91,6 @@ def test_template_is_executed_when_supplied
assert_match(/It works!/, capture(:stdout) { generator.invoke_all })
end
- def test_template_raises_an_error_with_invalid_path
- content = capture(:stderr){ run_generator([destination_root, "-m", "non/existant/path"]) }
- assert_match(/The template \[.*\] could not be loaded/, content)
- assert_match(/non\/existant\/path/, content)
- end
-
- def test_template_is_executed_when_supplied
- path = "http://gist.github.com/103208.txt"
- template = %{ say "It works!" }
- template.instance_eval "def read; self; end" # Make the string respond to read
-
- generator([destination_root], :template => path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template)
- assert_match(/It works!/, capture(:stdout) { generator.invoke_all })
- end
-
def test_template_is_executed_when_supplied_an_https_path
path = "https://gist.github.com/103208.txt"
template = %{ say "It works!" }

0 comments on commit 2b35575

Please sign in to comment.