Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a CLI test for updating an application.

  • Loading branch information...
commit 98eb09ee5e58ae2d53cd4ae26a9babd55d427d67 1 parent 0a51136
@Manfred Manfred authored
View
15 test/passenger_pane/cli_test.nu
@@ -57,6 +57,21 @@
(set arguments (NSString stringWithContentsOfFile:pathToCLIArguments encoding:NSUTF8StringEncoding error:nil))
(~ arguments should equal:"[\"add\", \"/path/to/test\", \"-path\", \"/path/to/test\", \"-environment\", \"production\", \"-host\", \"test.local\", \"-config_filename\", \"/path/to/test.conf\", \"-aliases\", \"assets.test.local\"]")
))
+
+ (it "updates an application" (do ()
+ (set attributes (NSMutableDictionary dictionary))
+ (attributes setValue:"test.local" forKey:"host")
+ (attributes setValue:"assets.test.local" forKey:"aliases")
+ (attributes setValue:"/path/to/test" forKey:"path")
+ (attributes setValue:"production" forKey:"environment")
+ (attributes setValue:"/path/to/test.conf" forKey:"config_filename")
+ (set application ((Application alloc) initWithAttributes:attributes))
+
+ (@cli update:application)
+
+ (set arguments (NSString stringWithContentsOfFile:pathToCLIArguments encoding:NSUTF8StringEncoding error:nil))
+ (~ arguments should equal:"[\"update\", \"test.local\", \"-path\", \"/path/to/test\", \"-environment\", \"production\", \"-host\", \"test.local\", \"-config_filename\", \"/path/to/test.conf\", \"-aliases\", \"assets.test.local\"]")
+ ))
))
((Bacon sharedInstance) run)
View
2  test/passenger_pane/fake_ppane/ppane
@@ -5,7 +5,7 @@ require File.expand_path('../../../../lib/passenger_pane/trust', __FILE__)
command = ARGV[0]
if command == 'list'
puts '[{"framework":"rails","hosts":["manager.boom.local","account.boom.local"],"path":"\/Users\/manfred\/Code\/boommanager","config_filename":"\/private\/etc\/apache2\/passenger_pane_vhosts\/boommanager.local.vhost.conf","host":"manager.boom.local","aliases":"account.boom.local","environment":"development","vhost_address":"*:80","user_defined_data":"<Directory \"\/Users\/manfred\/Code\/boommanager\/public\">\n Order allow,deny\n Allow from all\n <\/Directory>"},{"framework":"rails","hosts":["scoring.boom.local"],"path":"\/Users\/manfred\/Code\/boomscoring","config_filename":"\/private\/etc\/apache2\/passenger_pane_vhosts\/boomscoring.local.vhost.conf","host":"scoring.boom.local","aliases":"","environment":"development","vhost_address":"*:80","user_defined_data":"<Directory \"\/Users\/manfred\/Code\/boomscoring\/public\">\n Order allow,deny\n Allow from all\n <\/Directory>"},{"framework":"rails","hosts":["diagnose.local"],"path":"\/Users\/manfred\/Code\/diagnose","config_filename":"\/private\/etc\/apache2\/passenger_pane_vhosts\/diagnose.local.vhost.conf","host":"diagnose.local","aliases":"","environment":"development","vhost_address":"*:80","user_defined_data":"<Directory \"\/Users\/manfred\/Code\/diagnose\/public\">\n Order allow,deny\n Allow from all\n <\/Directory>"}]'
-elsif %w(add restart).include?(command)
+elsif %w(add update restart).include?(command)
require 'fileutils'
tmpdir = File.expand_path('../../../../tmp', __FILE__)
filename = File.join(tmpdir, '.test/args.txt')
Please sign in to comment.
Something went wrong with that request. Please try again.