summaryrefslogtreecommitdiff
path: root/spec/ruby/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb
blob: f5fa6f55e3944db0729601dd22166c81464be5b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require_relative '../fixtures/classes'

describe "Encoding::InvalidByteSequenceError#destination_encoding_name" do
  before :each do
    @exception, = EncodingSpecs::InvalidByteSequenceError.exception
    @exception2, = EncodingSpecs::InvalidByteSequenceErrorIndirect.exception
  end

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

  it "is equal to the destination encoding name of the object that raised it" do
    @exception.destination_encoding_name.should == "ISO-8859-1"
    @exception2.destination_encoding_name.should == "UTF-8"
  end
end