Sha256: 5149daf84238d9891885091efd09a4596bc5d34384b860e8a7ea1e5b8002eb5a

Contents?: true

Size: 971 Bytes

Versions: 19

Compression:

Stored size: 971 Bytes

Contents

require 'spec_helper'

class FileDouble
  def write
  end
end

describe ContentfulMiddleman::LocalData::Store do
  let(:path) { File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'backup_fixtures')) }

  before do
    described_class.base_path = nil
  end

  describe 'class methods' do
    it '::base_path / ::base_path=' do
      expect(described_class.base_path).to eq nil

      described_class.base_path = 'foo'

      expect(described_class.base_path).to eq 'foo'
    end
  end

  describe 'instance methods' do
    before do
      described_class.base_path = 'foo'
    end

    let(:file) { FileDouble.new }
    subject { described_class.new [file], path }

    describe '#write' do
      it 'writes with backup' do
        expect(subject).to receive(:do_with_backup)

        subject.write
      end

      it 'calls write on every file object' do
        expect(file).to receive(:write)

        subject.write
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
contentful_middleman-4.2.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-4.1.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-3.0.1 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-4.0.1 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-4.0.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-3.0.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-2.1.3 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-2.1.2 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-2.1.1 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-2.1.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-2.0.1 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-2.0.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.5.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.4.2 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.4.1 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.4.0 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.3.2 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.3.1 spec/contentful_middleman/local_data/store_spec.rb
contentful_middleman-1.2.0 spec/contentful_middleman/local_data/store_spec.rb