Sha256: 75ea6bb7e4e32828e4d926daa2532f149cd738abe3eb16259303d7ea30f51d32

Contents?: true

Size: 861 Bytes

Versions: 6

Compression:

Stored size: 861 Bytes

Contents

require 'spec_helper'

describe Pause::Configuration, "#configure" do

  subject { Pause::Configuration.new }

  it "should allow configuration via block" do
    subject.configure do |c|
      c.redis_host = "128.23.12.8"
      c.redis_port = "2134"
      c.redis_db = "13"

      c.resolution = 5000
      c.history = 6000
    end

    subject.redis_host.should == "128.23.12.8"
    subject.redis_port.should == 2134
    subject.redis_db.should == "13"

    subject.resolution.should == 5000
    subject.history.should == 6000
  end

  it "should provide redis defaults" do
    subject.configure do |config|
      # do nothing
    end

    subject.redis_host.should == "127.0.0.1"
    subject.redis_port.should == 6379
    subject.redis_db.should == "1"
    subject.resolution.should == 600 # 10 minutes
    subject.history.should == 86400 # one day
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pause-0.0.6 spec/pause/configuration_spec.rb
pause-0.0.5 spec/pause/configuration_spec.rb
pause-0.0.4 spec/pause/configuration_spec.rb
pause-0.0.3 spec/pause/configuration_spec.rb
pause-0.0.2 spec/pause/configuration_spec.rb
pause-0.0.1 spec/pause/configuration_spec.rb