require 'spec_helper' class RFlow module Components module HTTP module Extensions describe HTTPRequestExtension do it "should work" do Configuration.available_data_extensions['RFlow::Message::Data::HTTP::Request'].should include(described_class) Message.new('RFlow::Message::Data::HTTP::Request').data.tap do |d| d.uri.should == '/' d.method.should == 'GET' d.query_string.should == nil d.protocol.should == 'HTTP/1.0' d.headers.should == {} d.uri = '/foo' d.uri.should == '/foo' end end end describe HTTPResponseExtension do it "should work" do Configuration.available_data_extensions['RFlow::Message::Data::HTTP::Response'].should include(described_class) Message.new('RFlow::Message::Data::HTTP::Response').data.tap do |d| d.protocol.should == 'HTTP/1.0' d.status_code.should == 200 d.status_reason_phrase.should == 'OK' d.headers.should == {} d.content.should == '' d.status_code = 404 d.status_code.should == 404 end end end end end end end