Sha256: c3f842b08f36d13ebf414a833195a87e89d91846b35053bcea8128e6d0aa2d0f
Contents?: true
Size: 842 Bytes
Versions: 5
Compression:
Stored size: 842 Bytes
Contents
require "pp" # to avoid an error in fakefs require "fakefs" require "noter/note_file" module Noter describe NoteFile do let(:file) { Noter::NoteFile.new("2014_09_21_18_20_22.txt") } before do FileUtils.mkdir_p NoteFile.dir end it "returns a formatted time from the filename" do expect(file.formatted_time).to eql("09-21 18:20") end describe "#content" do before do File.write(file.filename, "some content") end it "returns the content of the file" do expect(file.content).to eql("some content") end end describe "#first_line" do before do File.write(file.filename, "some content\nline 2") end it "returns the content of the file" do expect(file.first_line).to eql("some content") end end end end
Version data entries
5 entries across 5 versions & 1 rubygems