spec/log_parser_spec.rb in wvanbergen-request-log-analyzer-0.3.4 vs spec/log_parser_spec.rb in wvanbergen-request-log-analyzer-1.0.0

- old
+ new

@@ -3,22 +3,22 @@ describe RequestLogAnalyzer::LogParser, :single_line_requests do include RequestLogAnalyzerSpecHelper before(:each) do - @log_parser = RequestLogAnalyzer::LogParser.new(TestFileFormat) + @log_parser = RequestLogAnalyzer::LogParser.new(spec_format) end it "should have line definitions" do @log_parser.file_format.line_definitions.should_not be_empty end - it "should have include the language specific hooks in the instance, not in the class" do - metaclass = (class << @log_parser; self; end) - metaclass.ancestors.should include(TestFileFormat::LogParser) - @log_parser.class.ancestors.should_not include(TestFileFormat::LogParser) - end + # it "should have include the language specific hooks in the instance, not in the class" do + # metaclass = (class << @log_parser; self; end) + # metaclass.ancestors.should include(TestFileFormat::LogParser) + # @log_parser.class.ancestors.should_not include(TestFileFormat::LogParser) + # end it "should parse a stream and find valid requests" do io = File.new(log_fixture(:test_file_format), 'r') @log_parser.parse_io(io, :line_types => [:test]) do |request| request.should be_kind_of(RequestLogAnalyzer::Request) @@ -36,11 +36,11 @@ describe RequestLogAnalyzer::LogParser, :combined_requests do include RequestLogAnalyzerSpecHelper before(:each) do - @log_parser = RequestLogAnalyzer::LogParser.new(TestFileFormat, :combined_requests => true) + @log_parser = RequestLogAnalyzer::LogParser.new(spec_format, :combined_requests => true) end it "should have multiple line definitions" do @log_parser.file_format.line_definitions.length.should >= 2 end @@ -72,21 +72,19 @@ describe RequestLogAnalyzer::LogParser, :warnings do include RequestLogAnalyzerSpecHelper it "should warn about teaser matching problems" do - @log_parser = RequestLogAnalyzer::LogParser.new(TestFileFormat) + @log_parser = RequestLogAnalyzer::LogParser.new(spec_format) @log_parser.should_receive(:warn).with(:teaser_check_failed, anything).exactly(5).times @log_parser.parse_file(log_fixture(:test_file_format)) end it "should warn about unmatching request headers and footers" do - @log_parser = RequestLogAnalyzer::LogParser.new(TestFileFormat, :combined_requests => true) + @log_parser = RequestLogAnalyzer::LogParser.new(spec_format, :combined_requests => true) @log_parser.should_receive(:warn).with(:unclosed_request, anything).at_least(1).times @log_parser.should_receive(:warn).with(:no_current_request, anything).at_least(1).times @log_parser.should_not_receive(:handle_request) @log_parser.parse_file(log_fixture(:test_order)) - end - end \ No newline at end of file