提交 2b355757 编写于 作者: C Carlos Antonio da Silva 提交者: Santiago Pastorino

Remove duplicated tests from shared generator

[Carlos Antonio da Silva & Santiago Pastorino]
上级 858a30e5
......@@ -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!" }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册