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