diff --git a/lib/docs/core/entry_index.rb b/lib/docs/core/entry_index.rb index e8b085d5..3c819c70 100644 --- a/lib/docs/core/entry_index.rb +++ b/lib/docs/core/entry_index.rb @@ -21,6 +21,8 @@ module Docs @entries.empty? end + alias_method :blank?, :empty? + def length @entries.length end diff --git a/test/lib/docs/core/entry_index_test.rb b/test/lib/docs/core/entry_index_test.rb index 52707569..98abba3a 100644 --- a/test/lib/docs/core/entry_index_test.rb +++ b/test/lib/docs/core/entry_index_test.rb @@ -64,14 +64,18 @@ class DocsEntryIndexTest < MiniTest::Spec end end - describe "#empty?" do - it "returns true when entries have been added" do + describe "#empty? / #blank? / #present?" do + it "is #empty? and #blank? when no entries have been added" do assert index.empty? + assert index.blank? + refute index.present? end - it "returns false when an entry has been added" do + it "is #present? when an entry has been added" do index.add(entry) refute index.empty? + refute index.blank? + assert index.present? end end