summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/struct/to_s_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/struct/to_s_spec.rb')
-rw-r--r--spec/rubyspec/core/struct/to_s_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/rubyspec/core/struct/to_s_spec.rb b/spec/rubyspec/core/struct/to_s_spec.rb
new file mode 100644
index 0000000000..b9fd413093
--- /dev/null
+++ b/spec/rubyspec/core/struct/to_s_spec.rb
@@ -0,0 +1,12 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+require File.expand_path('../shared/inspect', __FILE__)
+
+describe "Struct#to_s" do
+ it "is a synonym for inspect" do
+ car = StructClasses::Car.new('Ford', 'Ranger')
+ car.inspect.should == car.to_s
+ end
+
+ it_behaves_like(:struct_inspect, :to_s)
+end