Sha256: 023101835d1923cb14976c4f394cc2c7b620b9e42a93aeb500f110c14504a65c

Contents?: true

Size: 1.05 KB

Versions: 52

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path('../../fixtures/classes', __FILE__)

with_feature :encoding do
  describe "Encoding::InvalidByteSequenceError#error_bytes" do
    before(:each) do
      @exception, @errinfo = EncodingSpecs::InvalidByteSequenceError.exception
      @exception2, @errinfo2 = EncodingSpecs::InvalidByteSequenceErrorIndirect.exception
    end

    it "returns a String" do
      @exception.error_bytes.should be_an_instance_of(String)
      @exception2.error_bytes.should be_an_instance_of(String)
    end

    it "returns the bytes that caused the exception" do
      @exception.error_bytes.size.should == 1
      @exception.error_bytes.should == "\xF1"
      @exception.error_bytes.should == @errinfo[-2]

      @exception2.error_bytes.size.should == 1
      @exception2.error_bytes.should == "\xA1"
      @exception2.error_bytes.should == @errinfo2[-2]
    end

    it "uses ASCII-8BIT as the encoding" do
      @exception.error_bytes.encoding.should == Encoding::ASCII_8BIT

      @exception2.error_bytes.encoding.should == Encoding::ASCII_8BIT
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-3.3.5 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb