Sha256: fe0588d5999f8870df69e14209a886882e36f3a70aa023f6e550e47e259e5f31

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

describe Chicanery do
  include Chicanery

  describe '#run' do

    before do
      server double("Server A", :name => "A", :jobs => "A jobs")
      server double("Server B", :name => "B", :jobs => "B jobs")
      repo  double("repo X", :name => "X", :state => "X state")
      repo  double("repo Y", :name => "Y", :state => "Y state")
      when_run do |current_state|
         @current_state = current_state
      end
      @current_state = nil
    end

    before { stub!("restore").and_return({})}
    before { %w{persist}.each {|m| stub! m } }

    it "notifies when_run listeners of the current state of the servers jobs" do
      run
      @current_state[:servers]["A"].should == "A jobs"
      @current_state[:servers]["B"].should == "B jobs"
    end

    it "notifies when_run listeners of the current state of the repos" do
      run
      @current_state[:repos]["X"].should == "X state"
      @current_state[:repos]["Y"].should == "Y state"
    end

    #TESTS TODO
    # it restores previous state and records current state
    # it compares current state and previous state for each server
    # it compares current state and previous state for each server

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chicanery-0.1.4 spec/embedded_chicanery_spec.rb
chicanery-0.1.3 spec/embedded_chicanery_spec.rb
chicanery-0.1.1 spec/embedded_chicanery_spec.rb
chicanery-0.1.0 spec/embedded_chicanery_spec.rb
chicanery-0.0.9 spec/embedded_chicanery_spec.rb
chicanery-0.0.8 spec/embedded_chicanery_spec.rb