spec/sequencer_spec.rb in alephant-sequencer-1.0.0 vs spec/sequencer_spec.rb in alephant-sequencer-1.1.0
- old
+ new
@@ -23,11 +23,11 @@
def sequence_table
table = double()
table.stub(:create)
table.stub(:sequence_exists)
table.stub(:sequence_for)
- table.stub(:set_sequence_for)
+ table.stub(:update_sequence_id)
table.stub(:truncate!)
table
end
describe "#initialize(opts, id)" do
@@ -56,22 +56,22 @@
end
end
let(:a_proc) do
a_block = double()
- a_block.should_receive(:called).with(message)
+ a_block.should_receive(:called)
- Proc.new do |msg|
- a_block.called(msg)
+ Proc.new do
+ a_block.called
end
end
let(:stubbed_last_seen) { 2 }
let(:stubbed_seen_high) { 3 }
let(:stubbed_seen_low) { 1 }
- it "should call the passed block with msg" do
+ it "should call the passed block" do
subject = Alephant::Sequencer::Sequencer.new(sequence_table, ident, jsonpath)
subject.validate(message, &a_proc)
end
context "last_seen_id is nil" do
@@ -201,15 +201,15 @@
Alephant::Sequencer::Sequencer
.stub(:sequence_id_from)
.and_return(last_seen)
end
- it "calls set_sequence_for(ident, last_seen)" do
+ it "calls update_sequence_id(ident, last_seen)" do
table = double()
table.stub(:sequence_exists)
table.stub(:create)
table.stub(:sequence_for)
- table.should_receive(:set_sequence_for)
+ table.should_receive(:update_sequence_id)
.with(ident, last_seen, nil)
Alephant::Sequencer::Sequencer
.new(table, ident, jsonpath)
.set_last_seen(data)