aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/language
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language')
-rw-r--r--spec/ruby/language/predefined_spec.rb6
-rw-r--r--spec/ruby/language/string_spec.rb9
2 files changed, 12 insertions, 3 deletions
diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb
index 91cffce2e6..14f790a583 100644
--- a/spec/ruby/language/predefined_spec.rb
+++ b/spec/ruby/language/predefined_spec.rb
@@ -44,11 +44,11 @@ describe "Predefined global $~" do
it "is set to contain the MatchData object of the last match if successful" do
md = /foo/.match 'foo'
$~.should be_kind_of(MatchData)
- $~.object_id.should == md.object_id
+ $~.should equal md
/bar/ =~ 'bar'
$~.should be_kind_of(MatchData)
- $~.object_id.should_not == md.object_id
+ $~.should_not equal md
end
it "is set to nil if the last match was unsuccessful" do
@@ -828,7 +828,7 @@ end
describe "Global variable $\"" do
it "is an alias for $LOADED_FEATURES" do
- $".object_id.should == $LOADED_FEATURES.object_id
+ $".should equal $LOADED_FEATURES
end
it "is read-only" do
diff --git a/spec/ruby/language/string_spec.rb b/spec/ruby/language/string_spec.rb
index dbec2652ed..d1090e1771 100644
--- a/spec/ruby/language/string_spec.rb
+++ b/spec/ruby/language/string_spec.rb
@@ -42,6 +42,15 @@ describe "Ruby character strings" do
"#@ip#@ip".should == 'xxxxxx'
end
+ it "don't get confused by partial interpolation character sequences" do
+ "#@".should == '#@'
+ "#@ ".should == '#@ '
+ "#@@".should == '#@@'
+ "#@@ ".should == '#@@ '
+ "#$ ".should == '#$ '
+ "#\$".should == '#$'
+ end
+
it "taints the result of interpolation when an interpolated value is tainted" do
"#{"".taint}".tainted?.should be_true