Sha256: 39d1a0258ab354bb61c61cfc5ff291bbbc5095de33fafef9640850c7515ad039

Contents?: true

Size: 793 Bytes

Versions: 2

Compression:

Stored size: 793 Bytes

Contents

describe Chicanery do
  include Chicanery

  describe '#execute' do
    before { %w{load restore persist}.each {|m| stub! m } }

    it 'should load configuration and exit immediately when nothing is configured no poll period is provided' do
      should_receive(:load).with 'configuration'
      execute %w{configuration}
    end

    it 'should restore previous state' do
      should_receive(:restore)
      execute %w{configuration}
    end

    it 'should persist new state' do
      should_receive(:persist).with({
        servers: {},
        repos: {}
      })
      execute %w{configuration}
    end

    it 'should sleep for specified time when poll period is provided' do
      should_receive(:sleep).with(10).and_raise Interrupt
      execute %w{configuration 10}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chicanery-0.0.6 spec/chicanery_spec.rb
chicanery-0.0.5 spec/chicanery_spec.rb