Sha256: 9855004045e8cb7585eb1250c2fe3bd00adf2cddf908e2c4ecb02762c25b49fb

Contents?: true

Size: 779 Bytes

Versions: 17

Compression:

Stored size: 779 Bytes

Contents

RSpec.describe LessonsIndexer::Addons::FileManager::Writer do
  before :each do
    @writer = described_class.new('test.txt')
    @writer << 'test'
  end
  after(:all) {File.delete('test.txt')}

  specify "#name" do
    expect(@writer.name).to eq('test.txt')
  end

  specify "#<<" do
    contents = IO.read(@writer.name)
    expect(contents).to eq('test')
  end

  context "#prepend_data" do
    before(:each) {@writer.prepend_data('prepended')}
    it "should add data to the beginning" do
      expect(IO.read(@writer.name)).to eq('prependedtest')
    end

    it "should not add data to the beginning if data is already present" do
      @writer.prepend_data('prepended')
      expect(IO.read(@writer.name)).to eq('prependedtest')
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
lessons_indexer-1.3.0 spec/addons/file_manager_spec.rb
lessons_indexer-1.2.2 spec/addons/file_manager_spec.rb
lessons_indexer-1.2.1 spec/addons/file_manager_spec.rb
lessons_indexer-1.2.0 spec/addons/file_manager_spec.rb
lessons_indexer-1.1.0 spec/addons/file_manager_spec.rb
lessons_indexer-1.0.3 spec/addons/file_manager_spec.rb
lessons_indexer-1.0.2.1 spec/addons/file_manager_spec.rb
lessons_indexer-1.0.0 spec/addons/file_manager_spec.rb
lessons_indexer-0.3.1 spec/addons/file_manager_spec.rb
lessons_indexer-0.3.0 spec/addons/file_manager_spec.rb
lessons_indexer-0.2.3 spec/addons/file_manager_spec.rb
lessons_indexer-0.2.2 spec/addons/file_manager_spec.rb
lessons_indexer-0.2.1 spec/addons/file_manager_spec.rb
lessons_indexer-0.2.0 spec/addons/file_manager_spec.rb
lessons_indexer-0.1.2 spec/addons/file_manager_spec.rb
lessons_indexer-0.1.1 spec/addons/file_manager_spec.rb
lessons_indexer-0.1.0 spec/addons/file_manager_spec.rb