Sha256: 5697fcbba8fb6bcc315822d4725ccea6e15d79cf6a48cc0bd20ecf27fb47876c
Contents?: true
Size: 1002 Bytes
Versions: 1
Compression:
Stored size: 1002 Bytes
Contents
require 'leeroy/task' describe "Test Leeroy::Task::Stub New" do before(:each) do @stub = Leeroy::Task::Stub.new end it "get instance of Leeroy::Task::Stub" do expect(@stub).to be_instance_of(Leeroy::Task::Stub) end #stub.state.data it "responds to .perform" do expect(@stub).to respond_to(:perform) end it "Check that perform added a message to the .state.data hash" do @stub.perform expect(@stub.state.data).to include(:message) expect(@stub.state.data.message).to eq('0') @stub.perform expect(@stub.state.data.message).should_not eq('1') end end describe 'Test Leeroy::Task::Stub New { :increment => "1"}' do before(:each) do @stub = Leeroy::Task::Stub.new(:options => { :increment => "1"}) end it "Check :message can be incremented by 1" do @stub.perform expect(@stub.state.data).to include(:message) expect(@stub.state.data.message).to eq('1') @stub.perform expect(@stub.state.data.message).to eq('2') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
leeroy_app-0.5.4 | spec/task/stub_spec.rb |