Sha256: 9c69f291009fce820e610ae8c56d7396dc16da01633816f06dd52d8870d1f87f

Contents?: true

Size: 587 Bytes

Versions: 7

Compression:

Stored size: 587 Bytes

Contents

require "spec_helper"

module Healthety
  describe Worker do
    before(:each) do
      @block = Proc.new { interval 0.5; value 10 }
      @worker = Worker.new(:test, &@block)
    end

    it "should initialize" do
      @worker.name.should eq("test")
      @worker.instance_variable_get(:@block).should be(@block)
    end

    it "should perform" do
      @worker.perform

      @worker.interval.should eq(0.5)
      @worker.value.should eq(10)

      @worker.interval 0.7
      @worker.value 11

      @worker.interval.should eq(0.7)
      @worker.value.should eq(11)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
healthety-0.0.7 spec/unit/worker_spec.rb
healthety-0.0.6 spec/unit/worker_spec.rb
healthety-0.0.5 spec/unit/worker_spec.rb
healthety-0.0.4 spec/unit/worker_spec.rb
healthety-0.0.3 spec/unit/worker_spec.rb
healthety-0.0.2 spec/unit/worker_spec.rb
healthety-0.0.1 spec/unit/worker_spec.rb