Sha256: 142d7dde14410c3a4e37217c1f056162559e58117c41f07dcbd7f8fb253d9b00

Contents?: true

Size: 978 Bytes

Versions: 7

Compression:

Stored size: 978 Bytes

Contents

require File.expand_path('../test_helper', File.dirname(__FILE__))
require 'aws-sdk'

module Coverband
  class S3ReportWriterTest < Test::Unit::TestCase
    def html_version
      Gem::Specification.find_by_name('simplecov-html').version.version.to_s
    rescue StandardError
      '0.10.1'
    end

    test 'it writes the coverage report to s3' do
      s3 = mock('s3_resource')
      bucket = mock('bucket')
      object = mock('object')
      s3.expects(:bucket).with('coverage-bucket').returns(bucket)
      bucket.expects(:object).with('coverband/index.html').returns(object)
      File.expects(:read).at_least(0).returns("content ./assets/#{html_version}/")
      object.expects(:put).with(body: 'content ')
      Aws::S3::Resource.expects(:new).returns(s3)

      s3_writer_options = {
        region: 'us-west-1',
        access_key_id: '',
        secret_access_key: ''
      }
      S3ReportWriter.new('coverage-bucket', s3_writer_options).persist!
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
coverband-2.0.3 test/unit/s3_report_writer_test.rb
coverband-2.0.3.alpha test/unit/s3_report_writer_test.rb
coverband-2.0.2 test/unit/s3_report_writer_test.rb
coverband-2.0.2.alpha2 test/unit/s3_report_writer_test.rb
coverband-2.0.2.alpha test/unit/s3_report_writer_test.rb
coverband-2.0.1 test/unit/s3_report_writer_test.rb
coverband-2.0.1.alpha test/unit/s3_report_writer_test.rb