# -*- encoding: us-ascii -*-
#
with_feature :encoding do
  describe "Ruby String interpolation" do
    it "creates a String when a string doesn't have an encoding yet" do
      a = "ascii" 
      b = "\x00+/\xa8"
      b.instance_variable_set("@encoding", nil)

      str = "#{a}:#{b}"
      str.should == "ascii:\x00+/\xa8"
      str.encoding.should == Encoding::ASCII_8BIT
    end
  end
end

Add Rubinius specific spec for string building
Add Rubinius specific spec for string building

This ensures that we cover the behavior of string interpolation where
the string doesn't have an encoding yet. This is possible on Rubinius,
we only setup the encoding then in the method retrieving the encoding
from the string.

This is an extraction from issue #2222 and is added to prevent
regressions in this behavior.
