examples/example2.rb in cli_spinnable-0.1 vs examples/example2.rb in cli_spinnable-0.2
- old
+ new
@@ -1,30 +1,30 @@
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'cli_spinnable'
-module Foo
+module Cli
extend CliSpinnable
end
-puts 'HAPPY RUN (ending with success):'
-Foo.with_spinner do |cli|
+puts 'HAPPY RUN (should succeed):'
+Cli.with_spinner do |cli|
cli.print 'Downloading something'
sleep 1
cli.print '...downloaded 1MB'
cli.tick
cli.print 'Processing data'
sleep 1
cli.tick
end
-puts 'SAD RUN (ending with fail):'
-Foo.with_spinner do |cli|
+puts 'SAD RUN (should fail):'
+Cli.with_spinner do |cli|
cli.print 'Downloading something'
sleep 1
cli.print '...downloaded 1MB'
cli.tick
cli.print 'Processing data'
sleep 1
- 1 / 0
- cli.tick
+ 1 / 0 # produces exception
+ cli.tick # this will not be reached
end