aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/string/empty_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/empty_spec.rb')
-rw-r--r--spec/ruby/core/string/empty_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/core/string/empty_spec.rb b/spec/ruby/core/string/empty_spec.rb
new file mode 100644
index 0000000000..c13e1145e4
--- /dev/null
+++ b/spec/ruby/core/string/empty_spec.rb
@@ -0,0 +1,12 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes.rb', __FILE__)
+
+describe "String#empty?" do
+ it "returns true if the string has a length of zero" do
+ "hello".empty?.should == false
+ " ".empty?.should == false
+ "\x00".empty?.should == false
+ "".empty?.should == true
+ StringSpecs::MyString.new("").empty?.should == true
+ end
+end