spec/lib/dispatch-rider/configuration_spec.rb in dispatch-rider-1.4.2 vs spec/lib/dispatch-rider/configuration_spec.rb in dispatch-rider-1.5.0

- old
+ new

@@ -4,71 +4,71 @@ subject{ described_class.new } describe "defaults" do example do - subject.handler_path.should =~ /\/app\/handlers/ - subject.error_handler.should == DispatchRider::DefaultErrorHandler - subject.queue_kind.should == :file_system - subject.queue_info.should == { path: "tmp/dispatch-rider-queue" } - subject.subscriber.should == DispatchRider::Subscriber + expect(subject.handler_path).to match_regex(/\/app\/handlers/) + expect(subject.error_handler).to eq DispatchRider::DefaultErrorHandler + expect(subject.queue_kind).to eq :file_system + expect(subject.queue_info).to eq({ path: "tmp/dispatch-rider-queue" }) + expect(subject.subscriber).to eq DispatchRider::Subscriber end end describe "#before" do example do - subject.should respond_to(:before) + expect(subject).to respond_to :before end end describe "#after" do example do - subject.should respond_to(:after) + expect(subject).to respond_to :after end end describe "#around" do example do - subject.should respond_to(:around) + expect(subject).to respond_to :around end end describe "#handlers" do before :each do subject.handler_path = "./spec/fixtures/handlers" end it "loads the files and converts their names to symbols" do - subject.handlers.should include(:test_handler, :another_test_handler) + expect(subject.handlers).to include(:test_handler, :another_test_handler) end end - + describe "#default_retry_timeout" do it "sets the default timeout" do subject.default_retry_timeout = 60 - TestHandler.instance_methods.should include(:retry_timeout) + expect(TestHandler.instance_methods).to include(:retry_timeout) #Need to do this so that all the other tests don't have this as default! DispatchRider::Handlers::Base.send(:remove_method,:retry_timeout) end end describe "#logger" do describe "default" do - example { subject.logger.should be_kind_of(Logger) } + example { expect(subject.logger).to be_kind_of(Logger) } end - example { subject.should respond_to(:logger) } + example { expect(subject).to respond_to(:logger) } end describe "#logger=" do let(:new_logger) { double(:logger) } - example { subject.should respond_to(:logger=) } + example { expect(subject).to respond_to(:logger=) } example do subject.logger = new_logger - subject.logger.should == new_logger + expect(subject.logger).to eq new_logger end end end