summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/kernel/to_s_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/kernel/to_s_spec.rb')
-rw-r--r--spec/rubyspec/core/kernel/to_s_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/rubyspec/core/kernel/to_s_spec.rb b/spec/rubyspec/core/kernel/to_s_spec.rb
new file mode 100644
index 0000000000..c6fcca54a2
--- /dev/null
+++ b/spec/rubyspec/core/kernel/to_s_spec.rb
@@ -0,0 +1,16 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+
+describe "Kernel#to_s" do
+ it "returns a String containing the name of self's class" do
+ Object.new.to_s.should =~ /Object/
+ end
+
+ it "returns a tainted result if self is tainted" do
+ Object.new.taint.to_s.tainted?.should be_true
+ end
+
+ it "returns an untrusted result if self is untrusted" do
+ Object.new.untrust.to_s.untrusted?.should be_true
+ end
+end