aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/nil/to_h_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/nil/to_h_spec.rb')
-rw-r--r--spec/ruby/core/nil/to_h_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/nil/to_h_spec.rb b/spec/ruby/core/nil/to_h_spec.rb
new file mode 100644
index 0000000000..5300802d19
--- /dev/null
+++ b/spec/ruby/core/nil/to_h_spec.rb
@@ -0,0 +1,8 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "NilClass#to_h" do
+ it "returns an empty hash" do
+ nil.to_h.should == {}
+ nil.to_h.default.should == nil
+ end
+end