diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-27 20:21:25 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-27 20:21:25 +0000 |
commit | 37ef87c12b6c496001d0f199e46b4ecbfac5d394 (patch) | |
tree | 063c277e6343b299f6d47200e5b38f3af7975301 /spec/ruby/language | |
parent | ecf03376ec25fbd1ced6c0d1de110c6761e959fd (diff) | |
download | ruby-37ef87c12b6c496001d0f199e46b4ecbfac5d394.tar.gz |
Update to ruby/spec@cbe855c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/language')
-rw-r--r-- | spec/ruby/language/predefined_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/language/string_spec.rb | 9 |
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 |