spec/applix_spec.rb in applix-0.3.8 vs spec/applix_spec.rb in applix-0.4.2
- old
+ new
@@ -1,8 +1,23 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Applix" do
+ it 'cluster defaults shadow globals' do
+ args = %w(-c=5 global cluster)
+ Applix.main(args, a: :global, b: 2, :cluster => {a: :cluster, c: 3}) do
+ handle(:cluster) do
+ raise 'should not be called!'
+ end
+ cluster(:global) do
+ handle(:cluster) do |*args, options|
+ options.should == {:a => :cluster, :b => 2, :c => '5'}
+ args
+ end
+ end
+ end
+ end
+
it 'calls cluster prolog' do
Applix.main(%w(foo a b)) do
cluster(:foo) do
prolog { |args, options|
args.should == %w(a b)