aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/encoding/undefined_conversion_error/destination_encoding_spec.rb
blob: 579b0a37f88693c15794200029e9ff71c2e2ad85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require_relative '../fixtures/classes'

with_feature :encoding do
  describe "Encoding::UndefinedConversionError#destination_encoding" do
    before :each do
      @exception = EncodingSpecs::UndefinedConversionError.exception
    end

    it "returns an Encoding object" do
      @exception.destination_encoding.should be_an_instance_of(Encoding)
    end

    it "is equal to the destination encoding of the object that raised it" do
      @exception.destination_encoding.should == Encoding::US_ASCII
    end
  end
end