test/commands/clean_spec.rb in friends-0.46 vs test/commands/clean_spec.rb in friends-0.47
- old
+ new
@@ -13,11 +13,11 @@
describe "when file does not exist" do
let(:content) { nil }
it "does not create the file" do
- File.exist?(filename).must_equal false
+ value(File.exist?(filename)).must_equal false
end
end
describe "when file is empty" do
let(:content) { "" }
@@ -72,10 +72,11 @@
describe "when the content includes friends and locations that have not yet been added" do
let(:content) do
<<-CONTENT
### Activities:
- 2017-01-01: Celebrated the new year in _Paris_ with **Marie Curie** and her husband **Pierre Curie**. **Marie Curie** loves _Paris_!
+- 2016-12-31: Moved to _London_.
### Notes:
- 2017-01-01: I just learned that **Jacques Cousteau** is thinking about moving from _Gironde_ to _The Lost City of Atlantis_ (_Gironde_ did seem a bit too terrestrial for him).
### Friends:
@@ -88,10 +89,11 @@
it "adds those friends and locations" do
file_equals <<-CONTENT
### Activities:
- 2017-01-01: Celebrated the new year in _Paris_ with **Marie Curie** and her husband **Pierre Curie**. **Marie Curie** loves _Paris_!
+- 2016-12-31: Moved to _London_.
### Notes:
- 2017-01-01: I just learned that **Jacques Cousteau** is thinking about moving from _Gironde_ to _The Lost City of Atlantis_ (_Gironde_ did seem a bit too terrestrial for him).
### Friends:
@@ -100,10 +102,11 @@
- Marie Curie
- Pierre Curie
### Locations:
- Gironde
+- London
- NYC
- Paris
- The Lost City of Atlantis
CONTENT
end
@@ -111,9 +114,10 @@
it "prints messages for both cleaning and adding friends/locations" do
stdout_only <<-OUTPUT
Friend added: \"Marie Curie\"
Friend added: \"Pierre Curie\"
Location added: \"Paris\"
+Location added: \"London\"
Friend added: \"Jacques Cousteau\"
Location added: \"Gironde\"
Location added: \"The Lost City of Atlantis\"
File cleaned: \"#{filename}\"
OUTPUT