lib/cronicle/dsl/context.rb in cronicle-0.1.4 vs lib/cronicle/dsl/context.rb in cronicle-0.1.5

- old
+ new

@@ -40,9 +40,14 @@ if target.empty? raise ArgumentError, ':servers or :roles is not passed to `on` method' end target.assert_valid_keys(:servers, :roles) + values = Cronicle::DSL::Context::Job.new(target, &block).result.values - @result.concat(Cronicle::DSL::Context::Job.new(target, &block).result.values) + @result.concat(values.empty? ? [{ + :servers => Array(target[:servers]), + :roles => Array(target[:roles]), + :job => {} + }] : values) end end