test/test_command.rb in boom-0.0.10 vs test/test_command.rb in boom-0.1.0
- old
+ new
@@ -34,10 +34,17 @@
Boom::Command.capture_output
Boom::Command.execute(*cmd)
Boom::Command.captured_output
end
+ def test_overview_for_empty
+ storage = Boom::Storage
+ storage.stubs(:lists).returns([])
+ Boom::Command.stubs(:storage).returns(storage)
+ assert_match /have anything yet!/, command(nil)
+ end
+
def test_overview
assert_equal ' urls (2)', command(nil)
end
def test_list_detail
@@ -137,6 +144,21 @@
end
def test_echo_list_item_does_not_exist
assert_match /"wrong" not found in "urls"/, command('echo urls wrong')
end
+
+ def test_show_storage
+ assert_match /You're currently using json/, command('storage')
+ end
+
+ def test_nonexistant_storage_switch
+ Boom::Config.any_instance.stubs(:save).returns(true)
+ assert_match /couldn't find that storage engine/, command('switch dkdkdk')
+ end
+
+ def test_storage_switch
+ Boom::Config.any_instance.stubs(:save).returns(true)
+ assert_match /We've switched you over to redis/, command('switch redis')
+ end
+
end