<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Merlin/Main/Languages/Ruby/Tests/Interop/net/bcl/string/element_reference_spec.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/Ruby/Tests/Interop/net/bcl/string/include_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,79 +1,91 @@
 describe :string_slice, :shared =&gt; true do
+  before(:each) do
+    @hello ||= &quot;hello&quot;
+    @empty ||= &quot;&quot;
+  end
   it &quot;returns the character code of the character at the given index&quot; do
-    &quot;hello&quot;.send(@method, 0).should == ?h
-    &quot;hello&quot;.send(@method, -1).should == ?o
+    @hello.send(@method, 0).should == ?h
+    @hello.send(@method, -1).should == ?o
   end
 
   it &quot;returns nil if index is outside of self&quot; do
-    &quot;hello&quot;.send(@method, 20).should == nil
-    &quot;hello&quot;.send(@method, -20).should == nil
+    @hello.send(@method, 20).should == nil
+    @hello.send(@method, -20).should == nil
 
-    &quot;&quot;.send(@method, 0).should == nil
-    &quot;&quot;.send(@method, -1).should == nil
+    @empty.send(@method, 0).should == nil
+    @empty.send(@method, -1).should == nil
   end
 
   it &quot;calls to_int on the given index&quot; do
-    &quot;hello&quot;.send(@method, 0.5).should == ?h
+    @hello.send(@method, 0.5).should == ?h
 
     obj = mock('1')
     obj.should_receive(:to_int).and_return(1)
-    &quot;hello&quot;.send(@method, obj).should == ?e
+    @hello.send(@method, obj).should == ?e
   end
 
   it &quot;raises a TypeError if the given index is nil&quot; do
-    lambda { &quot;hello&quot;.send(@method, nil) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, nil) }.should raise_error(TypeError)
   end
 
   it &quot;raises a TypeError if the given index can't be converted to an Integer&quot; do
-    lambda { &quot;hello&quot;.send(@method, mock('x')) }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, {})        }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, [])        }.should raise_error(TypeError)
+    lambda { @hello.send(@method, mock('x')) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, {})        }.should raise_error(TypeError)
+    lambda { @hello.send(@method, [])        }.should raise_error(TypeError)
   end
 end
 
 describe :string_slice_index_length, :shared =&gt; true do
+  before(:each) do
+    @hello_there ||= &quot;hello there&quot;
+    @hello ||= &quot;hello&quot;
+    @empty ||= &quot;&quot;
+    @foo ||= &quot;foo&quot;
+    @x ||= &quot;x&quot;
+  end
+  
   it &quot;returns the substring starting at the given index with the given length&quot; do
-    &quot;hello there&quot;.send(@method, 0,0).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, 0,1).should == &quot;h&quot;
-    &quot;hello there&quot;.send(@method, 0,3).should == &quot;hel&quot;
-    &quot;hello there&quot;.send(@method, 0,6).should == &quot;hello &quot;
-    &quot;hello there&quot;.send(@method, 0,9).should == &quot;hello the&quot;
-    &quot;hello there&quot;.send(@method, 0,12).should == &quot;hello there&quot;
+    @hello_there.send(@method, 0,0).should == &quot;&quot;
+    @hello_there.send(@method, 0,1).should == &quot;h&quot;
+    @hello_there.send(@method, 0,3).should == &quot;hel&quot;
+    @hello_there.send(@method, 0,6).should == &quot;hello &quot;
+    @hello_there.send(@method, 0,9).should == &quot;hello the&quot;
+    @hello_there.send(@method, 0,12).should == &quot;hello there&quot;
 
-    &quot;hello there&quot;.send(@method, 1,0).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, 1,1).should == &quot;e&quot;
-    &quot;hello there&quot;.send(@method, 1,3).should == &quot;ell&quot;
-    &quot;hello there&quot;.send(@method, 1,6).should == &quot;ello t&quot;
-    &quot;hello there&quot;.send(@method, 1,9).should == &quot;ello ther&quot;
-    &quot;hello there&quot;.send(@method, 1,12).should == &quot;ello there&quot;
+    @hello_there.send(@method, 1,0).should == &quot;&quot;
+    @hello_there.send(@method, 1,1).should == &quot;e&quot;
+    @hello_there.send(@method, 1,3).should == &quot;ell&quot;
+    @hello_there.send(@method, 1,6).should == &quot;ello t&quot;
+    @hello_there.send(@method, 1,9).should == &quot;ello ther&quot;
+    @hello_there.send(@method, 1,12).should == &quot;ello there&quot;
 
-    &quot;hello there&quot;.send(@method, 3,0).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, 3,1).should == &quot;l&quot;
-    &quot;hello there&quot;.send(@method, 3,3).should == &quot;lo &quot;
-    &quot;hello there&quot;.send(@method, 3,6).should == &quot;lo the&quot;
-    &quot;hello there&quot;.send(@method, 3,9).should == &quot;lo there&quot;
+    @hello_there.send(@method, 3,0).should == &quot;&quot;
+    @hello_there.send(@method, 3,1).should == &quot;l&quot;
+    @hello_there.send(@method, 3,3).should == &quot;lo &quot;
+    @hello_there.send(@method, 3,6).should == &quot;lo the&quot;
+    @hello_there.send(@method, 3,9).should == &quot;lo there&quot;
 
-    &quot;hello there&quot;.send(@method, 4,0).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, 4,3).should == &quot;o t&quot;
-    &quot;hello there&quot;.send(@method, 4,6).should == &quot;o ther&quot;
-    &quot;hello there&quot;.send(@method, 4,9).should == &quot;o there&quot;
+    @hello_there.send(@method, 4,0).should == &quot;&quot;
+    @hello_there.send(@method, 4,3).should == &quot;o t&quot;
+    @hello_there.send(@method, 4,6).should == &quot;o ther&quot;
+    @hello_there.send(@method, 4,9).should == &quot;o there&quot;
 
-    &quot;foo&quot;.send(@method, 2,1).should == &quot;o&quot;
-    &quot;foo&quot;.send(@method, 3,0).should == &quot;&quot;
-    &quot;foo&quot;.send(@method, 3,1).should == &quot;&quot;
+    @foo.send(@method, 2,1).should == &quot;o&quot;
+    @foo.send(@method, 3,0).should == &quot;&quot;
+    @foo.send(@method, 3,1).should == &quot;&quot;
 
-    &quot;&quot;.send(@method, 0,0).should == &quot;&quot;
-    &quot;&quot;.send(@method, 0,1).should == &quot;&quot;
+    @empty.send(@method, 0,0).should == &quot;&quot;
+    @empty.send(@method, 0,1).should == &quot;&quot;
 
-    &quot;x&quot;.send(@method, 0,0).should == &quot;&quot;
-    &quot;x&quot;.send(@method, 0,1).should == &quot;x&quot;
-    &quot;x&quot;.send(@method, 1,0).should == &quot;&quot;
-    &quot;x&quot;.send(@method, 1,1).should == &quot;&quot;
+    @x.send(@method, 0,0).should == &quot;&quot;
+    @x.send(@method, 0,1).should == &quot;x&quot;
+    @x.send(@method, 1,0).should == &quot;&quot;
+    @x.send(@method, 1,1).should == &quot;&quot;
 
-    &quot;x&quot;.send(@method, -1,0).should == &quot;&quot;
-    &quot;x&quot;.send(@method, -1,1).should == &quot;x&quot;
+    @x.send(@method, -1,0).should == &quot;&quot;
+    @x.send(@method, -1,1).should == &quot;x&quot;
 
-    &quot;hello there&quot;.send(@method, -3,2).should == &quot;er&quot;
+    @hello_there.send(@method, -3,2).should == &quot;er&quot;
   end
 
   it &quot;always taints resulting strings when self is tainted&quot; do
@@ -86,57 +98,57 @@ describe :string_slice_index_length, :shared =&gt; true do
   end
 
   it &quot;returns nil if the offset falls outside of self&quot; do
-    &quot;hello there&quot;.send(@method, 20,3).should == nil
-    &quot;hello there&quot;.send(@method, -20,3).should == nil
+    @hello_there.send(@method, 20,3).should == nil
+    @hello_there.send(@method, -20,3).should == nil
 
-    &quot;&quot;.send(@method, 1,0).should == nil
-    &quot;&quot;.send(@method, 1,1).should == nil
+    @empty.send(@method, 1,0).should == nil
+    @empty.send(@method, 1,1).should == nil
 
-    &quot;&quot;.send(@method, -1,0).should == nil
-    &quot;&quot;.send(@method, -1,1).should == nil
+    @empty.send(@method, -1,0).should == nil
+    @empty.send(@method, -1,1).should == nil
 
-    &quot;x&quot;.send(@method, 2,0).should == nil
-    &quot;x&quot;.send(@method, 2,1).should == nil
+    @x.send(@method, 2,0).should == nil
+    @x.send(@method, 2,1).should == nil
 
-    &quot;x&quot;.send(@method, -2,0).should == nil
-    &quot;x&quot;.send(@method, -2,1).should == nil
+    @x.send(@method, -2,0).should == nil
+    @x.send(@method, -2,1).should == nil
   end
 
   it &quot;returns nil if the length is negative&quot; do
-    &quot;hello there&quot;.send(@method, 4,-3).should == nil
-    &quot;hello there&quot;.send(@method, -4,-3).should == nil
+    @hello_there.send(@method, 4,-3).should == nil
+    @hello_there.send(@method, -4,-3).should == nil
   end
 
   it &quot;calls to_int on the given index and the given length&quot; do
-    &quot;hello&quot;.send(@method, 0.5, 1).should == &quot;h&quot;
-    &quot;hello&quot;.send(@method, 0.5, 2.5).should == &quot;he&quot;
-    &quot;hello&quot;.send(@method, 1, 2.5).should == &quot;el&quot;
+    @hello.send(@method, 0.5, 1).should == &quot;h&quot;
+    @hello.send(@method, 0.5, 2.5).should == &quot;he&quot;
+    @hello.send(@method, 1, 2.5).should == &quot;el&quot;
 
     obj = mock('2')
     obj.should_receive(:to_int).exactly(4).times.and_return(2)
 
-    &quot;hello&quot;.send(@method, obj, 1).should == &quot;l&quot;
-    &quot;hello&quot;.send(@method, obj, obj).should == &quot;ll&quot;
-    &quot;hello&quot;.send(@method, 0, obj).should == &quot;he&quot;
+    @hello.send(@method, obj, 1).should == &quot;l&quot;
+    @hello.send(@method, obj, obj).should == &quot;ll&quot;
+    @hello.send(@method, 0, obj).should == &quot;he&quot;
   end
 
   it &quot;raises a TypeError when idx or length can't be converted to an integer&quot; do
-    lambda { &quot;hello&quot;.send(@method, mock('x'), 0) }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, 0, mock('x')) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, mock('x'), 0) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, 0, mock('x')) }.should raise_error(TypeError)
 
     # I'm deliberately including this here.
     # It means that str.send(@method, other, idx) isn't supported.
-    lambda { &quot;hello&quot;.send(@method, &quot;&quot;, 0) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, &quot;&quot;, 0) }.should raise_error(TypeError)
   end
 
   it &quot;raises a TypeError when the given index or the given length is nil&quot; do
-    lambda { &quot;hello&quot;.send(@method, 1, nil)   }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, nil, 1)   }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, nil, nil) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, 1, nil)   }.should raise_error(TypeError)
+    lambda { @hello.send(@method, nil, 1)   }.should raise_error(TypeError)
+    lambda { @hello.send(@method, nil, nil) }.should raise_error(TypeError)
   end
 
   it &quot;returns subclass instances&quot; do
-    s = StringSpecs::MyString.new(&quot;hello&quot;)
+    s = StringSpecs::MyString.new(@hello)
     s.send(@method, 0,0).class.should == StringSpecs::MyString
     s.send(@method, 0,4).class.should == StringSpecs::MyString
     s.send(@method, 1,4).class.should == StringSpecs::MyString
@@ -144,60 +156,68 @@ describe :string_slice_index_length, :shared =&gt; true do
 end
 
 describe :string_slice_range, :shared =&gt; true do
+  before(:each) do
+    @hello_there ||= &quot;hello there&quot;
+    @hello ||= &quot;hello&quot;
+    @hello_world ||= &quot;hello world&quot;
+    @empty ||= &quot;&quot;
+    @x ||= &quot;x&quot;
+    @good ||= &quot;GOOD&quot;
+  end
   it &quot;returns the substring given by the offsets of the range&quot; do
-    &quot;hello there&quot;.send(@method, 1..1).should == &quot;e&quot;
-    &quot;hello there&quot;.send(@method, 1..3).should == &quot;ell&quot;
-    &quot;hello there&quot;.send(@method, 1...3).should == &quot;el&quot;
-    &quot;hello there&quot;.send(@method, -4..-2).should == &quot;her&quot;
-    &quot;hello there&quot;.send(@method, -4...-2).should == &quot;he&quot;
-    &quot;hello there&quot;.send(@method, 5..-1).should == &quot; there&quot;
-    &quot;hello there&quot;.send(@method, 5...-1).should == &quot; ther&quot;
+    @hello_there.send(@method, 1..1).should == &quot;e&quot;
+    @hello_there.send(@method, 1..3).should == &quot;ell&quot;
+    @hello_there.send(@method, 1...3).should == &quot;el&quot;
+    @hello_there.send(@method, -4..-2).should == &quot;her&quot;
+    @hello_there.send(@method, -4...-2).should == &quot;he&quot;
+    @hello_there.send(@method, 5..-1).should == &quot; there&quot;
+    @hello_there.send(@method, 5...-1).should == &quot; ther&quot;
 
-    &quot;&quot;.send(@method, 0..0).should == &quot;&quot;
+    @empty.send(@method, 0..0).should == &quot;&quot;
 
-    &quot;x&quot;.send(@method, 0..0).should == &quot;x&quot;
-    &quot;x&quot;.send(@method, 0..1).should == &quot;x&quot;
-    &quot;x&quot;.send(@method, 0...1).should == &quot;x&quot;
-    &quot;x&quot;.send(@method, 0..-1).should == &quot;x&quot;
+    @x.send(@method, 0..0).should == &quot;x&quot;
+    @x.send(@method, 0..1).should == &quot;x&quot;
+    @x.send(@method, 0...1).should == &quot;x&quot;
+    @x.send(@method, 0..-1).should == &quot;x&quot;
 
-    &quot;x&quot;.send(@method, 1..1).should == &quot;&quot;
-    &quot;x&quot;.send(@method, 1..-1).should == &quot;&quot;
+    @x.send(@method, 1..1).should == @empty
+    @x.send(@method, 1..-1).should == @empty
   end
 
   it &quot;returns nil if the beginning of the range falls outside of self&quot; do
-    &quot;hello there&quot;.send(@method, 12..-1).should == nil
-    &quot;hello there&quot;.send(@method, 20..25).should == nil
-    &quot;hello there&quot;.send(@method, 20..1).should == nil
-    &quot;hello there&quot;.send(@method, -20..1).should == nil
-    &quot;hello there&quot;.send(@method, -20..-1).should == nil
+    @hello_there.send(@method, 12..-1).should == nil
+    @hello_there.send(@method, 20..25).should == nil
+    @hello_there.send(@method, 20..1).should == nil
+    @hello_there.send(@method, -20..1).should == nil
+    @hello_there.send(@method, -20..-1).should == nil
 
-    &quot;&quot;.send(@method, -1..-1).should == nil
-    &quot;&quot;.send(@method, -1...-1).should == nil
-    &quot;&quot;.send(@method, -1..0).should == nil
-    &quot;&quot;.send(@method, -1...0).should == nil
+    @empty.send(@method, -1..-1).should == nil
+    @empty.send(@method, -1...-1).should == nil
+    @empty.send(@method, -1..0).should == nil
+    @empty.send(@method, -1...0).should == nil
   end
 
   it &quot;returns an empty string if range.begin is inside self and &gt; real end&quot; do
-    &quot;hello there&quot;.send(@method, 1...1).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, 4..2).should == &quot;&quot;
-    &quot;hello&quot;.send(@method, 4..-4).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, -5..-6).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, -2..-4).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, -5..-6).should == &quot;&quot;
-    &quot;hello there&quot;.send(@method, -5..2).should == &quot;&quot;
+    @hello_there.send(@method, 1...1).should == @empty
+    @hello_there.send(@method, 4..2).should == @empty
+    @hello.send(@method, 4..-4).should == @empty
+    @hello_there.send(@method, -5..-6).should == @empty
+    @hello_there.send(@method, -2..-4).should == @empty
+    @hello_there.send(@method, -5..-6).should == @empty
+    @hello_there.send(@method, -5..2).should == @empty
 
-    &quot;&quot;.send(@method, 0...0).should == &quot;&quot;
-    &quot;&quot;.send(@method, 0..-1).should == &quot;&quot;
-    &quot;&quot;.send(@method, 0...-1).should == &quot;&quot;
+    @empty.send(@method, 0...0).should == &quot;&quot;
+    @empty.send(@method, 0..-1).should == &quot;&quot;
+    @empty.send(@method, 0...-1).should == &quot;&quot;
 
-    &quot;x&quot;.send(@method, 0...0).should == &quot;&quot;
-    &quot;x&quot;.send(@method, 0...-1).should == &quot;&quot;
-    &quot;x&quot;.send(@method, 1...1).should == &quot;&quot;
-    &quot;x&quot;.send(@method, 1...-1).should == &quot;&quot;
+    @x.send(@method, 0...0).should == @empty
+    @x.send(@method, 0...-1).should == @empty
+    @x.send(@method, 1...1).should == @empty
+    @x.send(@method, 1...-1).should == @empty
   end
 
   it &quot;always taints resulting strings when self is tainted&quot; do
-    str = &quot;hello world&quot;
+    str = @hello_world
     str.taint
 
     str.send(@method, 0..0).tainted?.should == true
@@ -209,7 +229,7 @@ describe :string_slice_range, :shared =&gt; true do
   end
 
   it &quot;returns subclass instances&quot; do
-    s = StringSpecs::MyString.new(&quot;hello&quot;)
+    s = StringSpecs::MyString.new(@hello)
     s.send(@method, 0...0).class.should == StringSpecs::MyString
     s.send(@method, 0..4).class.should == StringSpecs::MyString
     s.send(@method, 1..4).class.should == StringSpecs::MyString
@@ -225,12 +245,12 @@ describe :string_slice_range, :shared =&gt; true do
     from.should_receive(:to_int).twice.and_return(1)
     to.should_receive(:to_int).twice.and_return(-2)
 
-    &quot;hello there&quot;.send(@method, from..to).should == &quot;ello ther&quot;
-    &quot;hello there&quot;.send(@method, from...to).should == &quot;ello the&quot;
+    @hello_there.send(@method, from..to).should == &quot;ello ther&quot;
+    @hello_there.send(@method, from...to).should == &quot;ello the&quot;
   end
 
   it &quot;works with Range subclasses&quot; do
-    a = &quot;GOOD&quot;
+    a = @good
     range_incl = StringSpecs::MyRange.new(1, 2)
     range_excl = StringSpecs::MyRange.new(-3, -1, true)
 
@@ -240,17 +260,25 @@ describe :string_slice_range, :shared =&gt; true do
 end
 
 describe :string_slice_regexp, :shared =&gt; true do
+  before(:each) do
+    @hello_there ||= &quot;hello there&quot;
+    @hello ||= &quot;hello&quot;
+    @hello_world ||= &quot;hello world&quot;
+    @empty ||= &quot;&quot;
+    @x ||= &quot;x&quot;
+    @good ||= &quot;GOOD&quot;
+  end
   it &quot;returns the matching portion of self&quot; do
-    &quot;hello there&quot;.send(@method, /[aeiou](.)\1/).should == &quot;ell&quot;
-    &quot;&quot;.send(@method, //).should == &quot;&quot;
+    @hello_there.send(@method, /[aeiou](.)\1/).should == &quot;ell&quot;
+    @empty.send(@method, //).should == &quot;&quot;
   end
 
   it &quot;returns nil if there is no match&quot; do
-    &quot;hello there&quot;.send(@method, /xyz/).should == nil
+    @hello_there.send(@method, /xyz/).should == nil
   end
 
   it &quot;always taints resulting strings when self or regexp is tainted&quot; do
-    strs = [&quot;hello world&quot;]
+    strs = [@hello_world]
     strs += strs.map { |s| s.dup.taint }
 
     strs.each do |str|
@@ -265,37 +293,46 @@ describe :string_slice_regexp, :shared =&gt; true do
   end
 
   it &quot;returns subclass instances&quot; do
-    s = StringSpecs::MyString.new(&quot;hello&quot;)
+    s = StringSpecs::MyString.new(@hello)
     s.send(@method, //).class.should == StringSpecs::MyString
     s.send(@method, /../).class.should == StringSpecs::MyString
   end
 
   it &quot;sets $~ to MatchData when there is a match and nil when there's none&quot; do
-    'hello'.send(@method, /./)
+    @hello.send(@method, /./)
     $~[0].should == 'h'
 
-    'hello'.send(@method, /not/)
+    @hello.send(@method, /not/)
     $~.should == nil
   end
 end
 
 describe :string_slice_regexp_index, :shared =&gt; true do
+  before(:each) do
+    @hello_there ||= &quot;hello there&quot;
+    @hello ||= &quot;hello&quot;
+    @hello_world ||= &quot;hello world&quot;
+    @empty ||= &quot;&quot;
+    @x ||= &quot;x&quot;
+    @good ||= &quot;GOOD&quot;
+    @har ||= &quot;har&quot;
+  end
   it &quot;returns the capture for the given index&quot; do
-    &quot;hello there&quot;.send(@method, /[aeiou](.)\1/, 0).should == &quot;ell&quot;
-    &quot;hello there&quot;.send(@method, /[aeiou](.)\1/, 1).should == &quot;l&quot;
-    &quot;hello there&quot;.send(@method, /[aeiou](.)\1/, -1).should == &quot;l&quot;
+    @hello_there.send(@method, /[aeiou](.)\1/, 0).should == &quot;ell&quot;
+    @hello_there.send(@method, /[aeiou](.)\1/, 1).should == &quot;l&quot;
+    @hello_there.send(@method, /[aeiou](.)\1/, -1).should == &quot;l&quot;
 
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, 0).should == &quot;har&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, 1).should == &quot;h&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, 2).should == &quot;a&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, 3).should == &quot;r&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, -1).should == &quot;r&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, -2).should == &quot;a&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, -3).should == &quot;h&quot;
+    @har.send(@method, /(.)(.)(.)/, 0).should == &quot;har&quot;
+    @har.send(@method, /(.)(.)(.)/, 1).should == &quot;h&quot;
+    @har.send(@method, /(.)(.)(.)/, 2).should == &quot;a&quot;
+    @har.send(@method, /(.)(.)(.)/, 3).should == &quot;r&quot;
+    @har.send(@method, /(.)(.)(.)/, -1).should == &quot;r&quot;
+    @har.send(@method, /(.)(.)(.)/, -2).should == &quot;a&quot;
+    @har.send(@method, /(.)(.)(.)/, -3).should == &quot;h&quot;
   end
 
   it &quot;always taints resulting strings when self or regexp is tainted&quot; do
-    strs = [&quot;hello world&quot;]
+    strs = [@hello_world]
     strs += strs.map { |s| s.dup.taint }
 
     strs.each do |str|
@@ -317,59 +354,67 @@ describe :string_slice_regexp_index, :shared =&gt; true do
   end
 
   it &quot;returns nil if there is no match&quot; do
-    &quot;hello there&quot;.send(@method, /(what?)/, 1).should == nil
+    @hello_there.send(@method, /(what?)/, 1).should == nil
   end
 
   it &quot;returns nil if there is no capture for the given index&quot; do
-    &quot;hello there&quot;.send(@method, /[aeiou](.)\1/, 2).should == nil
+    @hello_there.send(@method, /[aeiou](.)\1/, 2).should == nil
     # You can't refer to 0 using negative indices
-    &quot;hello there&quot;.send(@method, /[aeiou](.)\1/, -2).should == nil
+    @hello_there.send(@method, /[aeiou](.)\1/, -2).should == nil
   end
 
   it &quot;calls to_int on the given index&quot; do
     obj = mock('2')
     obj.should_receive(:to_int).and_return(2)
 
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, 1.5).should == &quot;h&quot;
-    &quot;har&quot;.send(@method, /(.)(.)(.)/, obj).should == &quot;a&quot;
+    @har.send(@method, /(.)(.)(.)/, 1.5).should == &quot;h&quot;
+    @har.send(@method, /(.)(.)(.)/, obj).should == &quot;a&quot;
   end
 
   it &quot;raises a TypeError when the given index can't be converted to Integer&quot; do
-    lambda { &quot;hello&quot;.send(@method, /(.)(.)(.)/, mock('x')) }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, /(.)(.)(.)/, {})        }.should raise_error(TypeError)
-    lambda { &quot;hello&quot;.send(@method, /(.)(.)(.)/, [])        }.should raise_error(TypeError)
+    lambda { @hello.send(@method, /(.)(.)(.)/, mock('x')) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, /(.)(.)(.)/, {})        }.should raise_error(TypeError)
+    lambda { @hello.send(@method, /(.)(.)(.)/, [])        }.should raise_error(TypeError)
   end
 
   it &quot;raises a TypeError when the given index is nil&quot; do
-    lambda { &quot;hello&quot;.send(@method, /(.)(.)(.)/, nil) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, /(.)(.)(.)/, nil) }.should raise_error(TypeError)
   end
 
   it &quot;returns subclass instances&quot; do
-    s = StringSpecs::MyString.new(&quot;hello&quot;)
+    s = StringSpecs::MyString.new(@hello)
     s.send(@method, /(.)(.)/, 0).class.should == StringSpecs::MyString
     s.send(@method, /(.)(.)/, 1).class.should == StringSpecs::MyString
   end
 
   it &quot;sets $~ to MatchData when there is a match and nil when there's none&quot; do
-    'hello'.send(@method, /.(.)/, 0)
+    @hello.send(@method, /.(.)/, 0)
     $~[0].should == 'he'
 
-    'hello'.send(@method, /.(.)/, 1)
+    @hello.send(@method, /.(.)/, 1)
     $~[1].should == 'e'
 
-    'hello'.send(@method, /not/, 0)
+    @hello.send(@method, /not/, 0)
     $~.should == nil
   end
 end
 
 describe :string_slice_string, :shared =&gt; true do
+  before(:each) do
+    @hello_there ||= &quot;hello there&quot;
+    @hello ||= &quot;hello&quot;
+    @hello_world ||= &quot;hello world&quot;
+    @empty ||= &quot;&quot;
+    @x ||= &quot;x&quot;
+    @good ||= &quot;GOOD&quot;
+  end
   it &quot;returns other_str if it occurs in self&quot; do
     s = &quot;lo&quot;
-    &quot;hello there&quot;.send(@method, s).should == s
+    @hello_there.send(@method, s).should == s
   end
 
   it &quot;taints resulting strings when other is tainted&quot; do
-    strs = [&quot;&quot;, &quot;hello world&quot;, &quot;hello&quot;]
+    strs = [@empty, @hello_world, @hello]
     strs += strs.map { |s| s.dup.taint }
 
     strs.each do |str|
@@ -384,24 +429,24 @@ describe :string_slice_string, :shared =&gt; true do
   it &quot;doesn't set $~&quot; do
     $~ = nil
 
-    'hello'.send(@method, 'll')
+    @hello.send(@method, 'll')
     $~.should == nil
   end
 
   it &quot;returns nil if there is no match&quot; do
-    &quot;hello there&quot;.send(@method, &quot;bye&quot;).should == nil
+    @hello_there.send(@method, &quot;bye&quot;).should == nil
   end
 
   it &quot;doesn't call to_str on its argument&quot; do
     o = mock('x')
     o.should_not_receive(:to_str)
 
-    lambda { &quot;hello&quot;.send(@method, o) }.should raise_error(TypeError)
+    lambda { @hello.send(@method, o) }.should raise_error(TypeError)
   end
 
   it &quot;returns a subclass instance when given a subclass instance&quot; do
     s = StringSpecs::MyString.new(&quot;el&quot;)
-    r = &quot;hello&quot;.send(@method, s)
+    r = @hello.send(@method, s)
     r.should == &quot;el&quot;
     r.class.should == StringSpecs::MyString
   end</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/string/shared/slice.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fd24d8e276fbb04632aa168d15f62c6b55a551ef</id>
    </parent>
  </parents>
  <author>
    <name>Jim Deville</name>
    <email>jdeville@microsoft.com</email>
  </author>
  <url>http://github.com/shri/ironruby/commit/de470ca0e9e153b2349714eeea50d20e7bc39969</url>
  <id>de470ca0e9e153b2349714eeea50d20e7bc39969</id>
  <committed-date>2009-09-28T16:27:03-07:00</committed-date>
  <authored-date>2009-09-28T16:27:03-07:00</authored-date>
  <message>Regression tests for Codeplex #1927

http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=1927

For System::String#[] I've used as much from RubySpec as
possible. For include? I wrote my own</message>
  <tree>a83254034ce797eecb2a70603ff2f9cffece3bd8</tree>
  <committer>
    <name>Jim Deville</name>
    <email>jdeville@microsoft.com</email>
  </committer>
</commit>
