Sha256: 3b2f30bc83d243dc3cd5aac4694ea7870e633ecb3b9fa31adef0a31f40ce80f3

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

require 'spec_helper'
require 'gobuster/parsers/s3'

describe Gobuster::Parsers::S3 do
  describe ".parse" do
    let(:url)  { "http://test.s3.amazonaws.com/" }
    let(:line) { url }
    let(:io)   { StringIO.new(line + $/) }

    it "must parse each line and yield Gobuster::S3Bucket objects" do
      yielded_s3_buckets = []

      subject.parse(io) do |s3_bucket|
        yielded_s3_buckets << s3_bucket
      end

      expect(yielded_s3_buckets.length).to eq(1)
      expect(yielded_s3_buckets.first).to be_kind_of(Gobuster::S3Bucket)

      yielded_s3_bucket = yielded_s3_buckets.first

      expect(yielded_s3_bucket.url).to eq(url)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-gobuster-0.1.0 spec/parsers/s3_bucket_spec.rb