Sha256: 9078db90d960ab9c4fa05697acc3a840daa944e097c9f882c99f5ed011c319ef

Contents?: true

Size: 928 Bytes

Versions: 8

Compression:

Stored size: 928 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe 'XCRes::FileBuilder' do

  def subject
    XCRes::FileBuilder
  end

  before do
    @builder = subject.new
    @builder.logger = stub('Logger')
  end

  describe "#prepare_output_path!" do
    # TODO: Mock fs
  end

  describe "#build" do
    it 'should prepare output path' do
      @builder.expects(:prepare_output_path!)
      @builder.build
    end
  end

  describe "#build_contents" do
    it 'should call the given block' do
      proc = Proc.new {}
      proc.expects(:call)
      @builder.build_contents &proc
    end

    it 'should pass a StringBuilder as first argument to the given block' do
      @builder.build_contents do |builder|
        builder.should.be.an.instance_of?(XCRes::StringBuilder)
      end
    end
  end

  describe "#write_file_eventually" do
    # TODO: Mock fs
  end

  describe "#write_file" do
    # TODO: Mock fs
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xcres-0.6.1 spec/unit/builder/file_builder_spec.rb
xcres-0.6.0 spec/unit/builder/file_builder_spec.rb
xcres-0.5.0 spec/unit/builder/file_builder_spec.rb
xcres-0.4.4 spec/unit/builder/file_builder_spec.rb
xcres-0.4.3 spec/unit/builder/file_builder_spec.rb
xcres-0.4.2 spec/unit/builder/file_builder_spec.rb
xcres-0.4.1 spec/unit/builder/file_builder_spec.rb
xcres-0.4.0 spec/unit/builder/file_builder_spec.rb