Sha256: 66291f59d350b6c6cbc3f2a03b97136d526aa21c008e9948be6d4ade58e9bedf

Contents?: true

Size: 1.28 KB

Versions: 8

Compression:

Stored size: 1.28 KB

Contents

require "barnyard_harvester"

describe BarnyardHarvester do

  it "no parameters should raise error" do
    lambda{BarnyardHarvester::Sync.new}.should raise_error
  end

  it "passing only :crop_number => 1 should return BarnyardHarvester::Sync object" do
    BarnyardHarvester::Sync.new(crop_number: 1).class.should eq(BarnyardHarvester::Sync)
  end

  it "default backend should be :redis" do
    BarnyardHarvester::Sync.new(crop_number: 1).backend.should eq(:redis)
  end

  it "passing backend :hash should be :hash" do
    BarnyardHarvester::Sync.new(crop_number: 1, backend: :hash).backend.should eq(:hash)
  end

  it "passing bogus backend should raise an error" do
    lambda{BarnyardHarvester::Sync.new(crop_number: 1, backend: :foobar)}.should raise_error
  end

  it "crop_number should be 1001" do
    BarnyardHarvester::Sync.new(crop_number: 1001).crop_number.should eq(1001)
  end

  it "all counters should be zero" do
    BarnyardHarvester::Sync.new(crop_number: 1).change_count.should eq(0)
    BarnyardHarvester::Sync.new(crop_number: 1).add_count.should eq(0)
    BarnyardHarvester::Sync.new(crop_number: 1).delete_count.should eq(0)
    BarnyardHarvester::Sync.new(crop_number: 1).source_count.should eq(0)
    BarnyardHarvester::Sync.new(crop_number: 1).cache_count.should eq(0)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
barnyard_harvester-0.0.10 spec/loader_spec.rb
barnyard_harvester-0.0.9 spec/loader_spec.rb
barnyard_harvester-0.0.8 spec/loader_spec.rb
barnyard_harvester-0.0.7 spec/loader_spec.rb
barnyard_harvester-0.0.5 spec/loader_spec.rb
barnyard_harvester-0.0.3 spec/loader_spec.rb
barnyard_harvester-0.0.2 spec/loader_spec.rb
barnyard_harvester-0.0.1 spec/loader_spec.rb