From bee3e099bd3f4038f8a4122ad48446a232cbf21a Mon Sep 17 00:00:00 2001 From: Matt Duncan Date: Sat, 8 Aug 2009 18:07:17 -0400 Subject: Users can now pass :branch for git plugins and :revision for subversion plugins [#2352 status:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/test/generators/actions_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'railties/test') diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index 0cda49702b..fdaef6d9cb 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -29,11 +29,26 @@ class ActionsTest < GeneratorsTestCase action :plugin, 'restful-authentication', :svn => @svn_plugin_uri end + def test_plugin_with_git_option_and_branch_should_run_plugin_install + generator.expects(:run_ruby_script).once.with("script/plugin install -b stable #{@git_plugin_uri}", :verbose => false) + action :plugin, 'restful-authentication', :git => @git_plugin_uri, :branch => 'stable' + end + + def test_plugin_with_svn_option_and_revision_should_run_plugin_install + generator.expects(:run_ruby_script).once.with("script/plugin install -r 1234 #{@svn_plugin_uri}", :verbose => false) + action :plugin, 'restful-authentication', :svn => @svn_plugin_uri, :revision => 1234 + end + def test_plugin_with_git_option_and_submodule_should_use_git_scm generator.expects(:run).with("git submodule add #{@git_plugin_uri} vendor/plugins/rest_auth", :verbose => false) action :plugin, 'rest_auth', :git => @git_plugin_uri, :submodule => true end + def test_plugin_with_git_option_and_submodule_should_use_git_scm + generator.expects(:run).with("git submodule add -b stable #{@git_plugin_uri} vendor/plugins/rest_auth", :verbose => false) + action :plugin, 'rest_auth', :git => @git_plugin_uri, :submodule => true, :branch => 'stable' + end + def test_plugin_with_no_options_should_skip_method generator.expects(:run).never action :plugin, 'rest_auth', {} -- cgit v1.2.3