Sha256: b39c4c1ba332765b1456311f6ef01e6efb992aeeb2317b935e7ee0582e697bd9

Contents?: true

Size: 640 Bytes

Versions: 11

Compression:

Stored size: 640 Bytes

Contents

require 'spec_helper'

module CodeClimate::TestReporter

  describe CalculateBlob do

    subject { CalculateBlob.new(fixture) }
    let(:fixture) { File.expand_path("../../fixtures/encoding_test.rb", __FILE__) }

    it 'hex digests content of file' do
      expect(subject.blob_id).to_not be_nil
    end

    context 'encoding error' do

      let(:fixture) { File.expand_path("../../fixtures/encoding_test_iso.rb", __FILE__) }

      it 'falls back to git' do
        expect(File).to receive(:open).and_raise(EncodingError)
        expect(subject.blob_id).to eq('eb82c22dadb9c47a7fed87211623f6856e112f46')
      end

    end

  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
construi-0.6.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/spec/lib/calculate_blob_spec.rb
construi-0.5.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/spec/lib/calculate_blob_spec.rb
construi-0.4.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/spec/lib/calculate_blob_spec.rb
construi-0.2.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/spec/lib/calculate_blob_spec.rb
construi-0.1.0 vendor/bundle/ruby/1.9.1/gems/codeclimate-test-reporter-0.4.6/spec/lib/calculate_blob_spec.rb
codeclimate-test-reporter-0.4.7 spec/lib/calculate_blob_spec.rb
codeclimate-test-reporter-0.4.6 spec/lib/calculate_blob_spec.rb
codeclimate-test-reporter-0.4.5 spec/lib/calculate_blob_spec.rb
codeclimate-test-reporter-0.4.4 spec/lib/calculate_blob_spec.rb
codeclimate-test-reporter-0.4.3 spec/lib/calculate_blob_spec.rb
codeclimate-test-reporter-0.4.2 spec/lib/calculate_blob_spec.rb