Sha256: e4ae0039ca36a47816da88f8e03d3cc6480418b6fcc9e3bbcba5a001d47e6977

Contents?: true

Size: 569 Bytes

Versions: 10

Compression:

Stored size: 569 Bytes

Contents

require 'spec_helper'
require 'approvals/dotfile'

describe Approvals::Dotfile do
  let(:dotfile) { '/tmp/.approvals' }

  before(:each) do
    allow(Approvals::Dotfile).to receive(:path).and_return dotfile
    Approvals::Dotfile.reset
  end

  it "appends the text" do
    Approvals::Dotfile.append('text')
    expect(File.readlines(dotfile).map(&:chomp)).to eq ['text']
  end

  it "appends the text exactly once" do
    Approvals::Dotfile.append('text')
    Approvals::Dotfile.append('text')
    expect(File.readlines(dotfile).map(&:chomp)).to eq ['text']
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
approvals-0.0.26 spec/dotfile_spec.rb
approvals-0.0.25 spec/dotfile_spec.rb
approvals-0.0.24 spec/dotfile_spec.rb
br-approvals-0.0.22 spec/dotfile_spec.rb
approvals-0.0.22 spec/dotfile_spec.rb
approvals-0.0.21 spec/dotfile_spec.rb
approvals-0.0.20 spec/dotfile_spec.rb
approvals-0.0.19 spec/dotfile_spec.rb
approvals-0.0.18 spec/dotfile_spec.rb
approvals-0.0.17 spec/dotfile_spec.rb