spec/sequencer_spec.rb in alephant-sequencer-0.3.0 vs spec/sequencer_spec.rb in alephant-sequencer-1.0.0
- old
+ new
@@ -38,11 +38,11 @@
expect(subject.ident).to eq(ident)
end
end
- describe "#sequence(msg, &block)" do
+ describe "#validate(msg, &block)" do
let(:message) do
m = double()
m.stub(:body)
m
end
@@ -69,11 +69,11 @@
let(:stubbed_seen_high) { 3 }
let(:stubbed_seen_low) { 1 }
it "should call the passed block with msg" do
subject = Alephant::Sequencer::Sequencer.new(sequence_table, ident, jsonpath)
- subject.sequence(message, &a_proc)
+ subject.validate(message, &a_proc)
end
context "last_seen_id is nil" do
before(:each) do
Alephant::Sequencer::Sequencer
@@ -91,11 +91,11 @@
.any_instance
.should_receive(:set_last_seen)
.with(message, nil)
subject = Alephant::Sequencer::Sequencer.new(sequence_table, ident, jsonpath)
- subject.sequence(message, &a_proc)
+ subject.validate(message, &a_proc)
end
end
context "last_seen_id == sequence_id_from(msg)" do
before(:each) do
@@ -113,11 +113,11 @@
Alephant::Sequencer::Sequencer
.any_instance
.should_not_receive(:set_last_seen)
subject = Alephant::Sequencer::Sequencer.new(sequence_table, ident, jsonpath)
- subject.sequence(message, &a_proc)
+ subject.validate(message, &a_proc)
end
end
context "last_seen_id > sequence_id_from(msg)" do
before(:each) do
@@ -136,11 +136,11 @@
Alephant::Sequencer::Sequencer
.any_instance
.should_not_receive(:set_last_seen)
subject = Alephant::Sequencer::Sequencer.new(sequence_table, ident, jsonpath)
- subject.sequence(message, &a_proc)
+ subject.validate(message, &a_proc)
end
context "keep_all is false" do
let(:keep_all) { false }
it "should not call the passed block with msg" do
@@ -148,11 +148,11 @@
sequence_table,
ident,
jsonpath,
keep_all
)
- subject.sequence(message, &an_uncalled_proc)
+ subject.validate(message, &an_uncalled_proc)
end
end
end
context "last_seen_id < sequence_id_from(msg)" do
@@ -172,10 +172,10 @@
.any_instance
.should_receive(:set_last_seen)
.with(message, stubbed_last_seen)
subject = Alephant::Sequencer::Sequencer.new(sequence_table, ident, jsonpath)
- subject.sequence(message, &a_proc)
+ subject.validate(message, &a_proc)
end
end
end
describe "#get_last_seen" do