spec/kpm/remote/installer_spec.rb in kpm-0.0.15 vs spec/kpm/remote/installer_spec.rb in kpm-0.1.0

- old
+ new

@@ -22,10 +22,13 @@ 'version' => '0.7.1' }], 'ruby' => [{ 'name' => 'payment-test-plugin', 'version' => '1.8.7' + }, + { + 'name' => 'stripe' }] }, }, 'kaui' => { 'webapp_path' => kaui_webapp_path @@ -33,32 +36,42 @@ }, @logger) installer.install + check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path) - [ - plugins_dir, - plugins_dir + '/platform', - plugins_dir + '/plugins', - plugins_dir + '/plugins/java', - plugins_dir + '/plugins/java/analytics-plugin', - plugins_dir + '/plugins/java/analytics-plugin/0.7.1', - plugins_dir + '/plugins/ruby', - plugins_dir + '/plugins/ruby/killbill-payment-test', - plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7' - ].each do |dir| - File.directory?(dir).should be_true - end + # Verify idempotency + installer.install + check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path) + end + end - [ - kb_webapp_path, - kaui_webapp_path, - plugins_dir + '/platform/jruby.jar', - plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar', - plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7/killbill.properties' - ].each do |file| - File.file?(file).should be_true - end + private + + def check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path) + [ + plugins_dir, + plugins_dir + '/platform', + plugins_dir + '/plugins', + plugins_dir + '/plugins/java', + plugins_dir + '/plugins/java/analytics-plugin', + plugins_dir + '/plugins/java/analytics-plugin/0.7.1', + plugins_dir + '/plugins/ruby', + plugins_dir + '/plugins/ruby/killbill-payment-test', + plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7', + plugins_dir + '/plugins/ruby/killbill-stripe' + ].each do |dir| + File.directory?(dir).should be_true + end + + [ + kb_webapp_path, + kaui_webapp_path, + plugins_dir + '/platform/jruby.jar', + plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar', + plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7/killbill.properties' + ].each do |file| + File.file?(file).should be_true end end end