spec/unit/throttler_spec.rb in lhm-2.1.0 vs spec/unit/throttler_spec.rb in lhm-2.2.0

- old
+ new

@@ -9,26 +9,26 @@ @mock = Class.new do extend Lhm::Throttler end end - describe "#setup_throttler" do - describe "when passing a key" do + describe '#setup_throttler' do + describe 'when passing a key' do before do @mock.setup_throttler(:time_throttler, :delay => 2) end - it "instantiates the time throttle" do + it 'instantiates the time throttle' do @mock.throttler.class.must_equal Lhm::Throttler::Time end - it "returns 2 seconds as time" do + it 'returns 2 seconds as time' do @mock.throttler.timeout_seconds.must_equal 2 end end - describe "when passing an instance" do + describe 'when passing an instance' do before do @instance = Class.new(Lhm::Throttler::Time) do def timeout_seconds 0 @@ -36,38 +36,38 @@ end.new @mock.setup_throttler(@instance) end - it "returns the instace given" do + it 'returns the instace given' do @mock.throttler.must_equal @instance end - it "returns 0 seconds as time" do + it 'returns 0 seconds as time' do @mock.throttler.timeout_seconds.must_equal 0 end end - describe "when passing a class" do + describe 'when passing a class' do before do @klass = Class.new(Lhm::Throttler::Time) @mock.setup_throttler(@klass) end - it "has the same class as given" do + it 'has the same class as given' do @mock.throttler.class.must_equal @klass end end end - describe "#throttler" do + describe '#throttler' do - it "returns the default Time based" do + it 'returns the default Time based' do @mock.throttler.class.must_equal Lhm::Throttler::Time end - it "should default to 100 milliseconds" do + it 'should default to 100 milliseconds' do @mock.throttler.timeout_seconds.must_equal 0.1 end end end