spec/entry_spec.rb in rb-dayone-0.1.7 vs spec/entry_spec.rb in rb-dayone-0.2.0
- old
+ new
@@ -1,20 +1,17 @@
require './spec/spec_helper'
require 'fileutils'
describe DayOne::Entry do
-
- let(:entry){ DayOne::Entry.new }
-
after :all do
Dir['spec/entries/*.doentry'].each{ |f| FileUtils.rm(f) }
FileUtils.rmdir('spec/entries')
end
describe "#to_xml" do
it "should give a default entry" do
- e = entry.to_xml
+ e = subject.to_xml
e.should match %r|<key>Entry Text</key>\s*<string></string>|
e.should match %r|<key>Starred</key>\s*<false/>|
end
it "should set from initialize" do
@@ -32,10 +29,10 @@
describe "#create!" do
it "should correctly create a .doentry file" do
DayOne::journal_location = 'spec'
FileUtils::mkdir_p 'spec/entries'
- e = entry
+ e = subject
e.entry_text = "Hello, world!"
e.create!
file_location = Dir['spec/entries/*.doentry'][0]
file_location.should_not be_nil
\ No newline at end of file