Sha256: 3b95f79319ff10dc33ef75d562a99445c2409d40a8f5b95bc7d51cccbb738976

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

require File.join( File.dirname(__FILE__),  "spec_helper" )

include Updater

require  File.join( File.dirname(__FILE__),  "fooclass" )

describe "Special Parameter Substitution" do
  before :each do
    Update.clear_all
    @u = Update.chain(Foo,:chained, [:__job__,:__params__,:__self__, 'job params'])
  end
  
  it "should substitute __job__ with job that chained in" do
    Foo.should_receive(:chained).with(:arg1,anything(),anything(),'job params')
    @u.run(:arg1)
  end
  
  it "should substitute __params__ with params" do
    Foo.should_receive(:chained).with(anything(),:arg2,anything(), 'job params')
    @u.params = :arg2
    @u.run(:arg1)
  end
  
  it "should substitute __self__ with the current job" do
    Foo.should_receive(:chained).with(anything(),anything(),@u, 'job params')
    @u.run
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
updater-0.10.1 spec/params_sub_spec.rb
updater-0.10.0 spec/params_sub_spec.rb