spec/lib/bankserv/engine/engine_spec.rb in bankserv-0.8.0 vs spec/lib/bankserv/engine/engine_spec.rb in bankserv-0.8.1

- old
+ new

@@ -65,11 +65,11 @@ Bankserv::Engine.config[:interval_in_minutes].should == 15 Bankserv::Engine.config[:output_directory].should == Dir.pwd + "/spec/examples/host2host" end it "should not have any running processes" do - Bankserv::Engine.running?.should be_false + Bankserv::Engine.running?.should be_falsey end end # it "should retrieve services which can transmit input documents" do @@ -77,14 +77,14 @@ # credit_service = Bankserv::CreditService.register(client_code: '12345', client_name: "RCTEST", client_abbreviated_name: 'RCTEST', user_code: "95345", transmission_status: "L", transmission_number: "1", outgoing_directory: Dir.pwd + "/spec/examples/95345/outgoing", incoming_directory: Dir.pwd + "/spec/examples/95345/incoming", reply_directory: Dir.pwd + "/spec/examples/95345/incoming", archive_directory: Dir.pwd + "/spec/examples/95345/archive") # ahv_service = Bankserv::AHVService.register(client_code: '12345', internal_branch_code: '632005', department_code: "506", client_name: "TESTTEST", client_abbreviated_name: 'TESTTEST', generation_number: 1, transmission_status: "L", transmission_number: "1", user_code: "999", outgoing_directory: Dir.pwd + "/spec/examples/9999/outgoing", incoming_directory: Dir.pwd + "/spec/examples/9999/incoming", reply_directory: Dir.pwd + "/spec/examples/9999/incoming", archive_directory: Dir.pwd + "/spec/examples/9999/archive") # statement_service = Bankserv::StatementService.register(client_code: '12346', client_name: "TESTTEST", client_abbreviated_name: 'TESTTEST', user_code: "99999", generation_number: 1, transmission_status: "L", transmission_number: "1", outgoing_directory: Dir.pwd + "/spec/examples/99999/outgoing", incoming_directory: Dir.pwd + "/spec/examples/99999/incoming", reply_directory: Dir.pwd + "/spec/examples/99999/incoming", archive_directory: Dir.pwd + "/spec/examples/99999/archive") # # input_services = Bankserv::Engine.new.input_services - # input_services.include?(debit_service).should be_true - # input_services.include?(credit_service).should be_true - # input_services.include?(ahv_service).should be_true - # input_services.include?(statement_service).should be_false + # input_services.include?(debit_service).should be_truthy + # input_services.include?(credit_service).should be_truthy + # input_services.include?(ahv_service).should be_truthy + # input_services.include?(statement_service).should be_falsey # end context "Testing individual methods of engine" do before(:all) do @@ -102,19 +102,19 @@ @engine = Bankserv::Engine.new(@debit_service) end it "should be able to start processing work" do - @engine.start!.should be_true + @engine.start!.should be_truthy end it "should be set to running" do - @engine.running?.should be_true + @engine.running?.should be_truthy end it "should be expecting a reply file" do - @engine.expecting_reply_file?(@debit_service).should be_true + @engine.expecting_reply_file?(@debit_service).should be_truthy end it "should be able to return a list of reply files" do Bankserv::Engine.reply_files(@debit_service).should == ["REPLY0412153000.txt"] end @@ -124,25 +124,25 @@ end it "should be able to process reply files" do @engine.process_reply_files Bankserv::Document.first.reply_status.should == "ACCEPTED" - @engine.expecting_reply_file?(@debit_service).should be_false + @engine.expecting_reply_file?(@debit_service).should be_falsey end it "should be able to process output files" do @engine.process_output_files end it "should be able to set the process to finished" do - @engine.finish!.should be_true - @engine.running?.should be_false - @engine.process.success.should be_true + @engine.finish!.should be_truthy + @engine.running?.should be_falsey + @engine.process.success.should be_truthy end it "should not have any processes running" do - Bankserv::Engine.running?.should be_false + Bankserv::Engine.running?.should be_falsey end end context "Processing an input document." do @@ -165,16 +165,16 @@ end it "should process the document" do @engine.process_input_files @document = Bankserv::Document.last - @document.processed.should be_true - @engine.expecting_reply_file?(@service).should be_true + @document.processed.should be_truthy + @engine.expecting_reply_file?(@service).should be_truthy end it "should write a file to the input directory" do - (Dir.glob("#{@service.config[:outgoing_directory]}/INPUT*.txt").size == 1).should be_true + (Dir.glob("#{@service.config[:outgoing_directory]}/INPUT*.txt").size == 1).should be_truthy end end context "Integration testing for statement service" do @@ -211,10 +211,10 @@ Dir.entries(Dir.pwd + "/spec/examples/K010831/incoming").should == [".", ".."] Dir.entries(Dir.pwd + "/spec/examples/K010831/archive").should == [".", "..", "2008"] end it "should mark the engines process as completed" do - Bankserv::Engine.running?.should be_false + Bankserv::Engine.running?.should be_falsey end end end \ No newline at end of file