Sha256: e5243e0a9ba32c8794bb990ad75066ceac17713b883454b31a9627d0cc560ef2

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Yardstick::ReportOutput, 'write' do
  subject do
    described_class.new(target).write do |io|
      io.puts 'content'
    end
  end

  let(:target)  { double('Pathname', dirname: dirname) }
  let(:dirname) { double                               }

  before do
    dirname.stub(:mkpath)
    target.stub(:open)
  end

  it 'should create directory' do
    dirname.should_receive(:mkpath)
    subject
  end

  it 'should write content' do
    io = double
    io.should_receive(:puts).with('content')
    target.should_receive(:open).with('w').and_yield(io)
    subject
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yardstick-0.9.7 spec/unit/yardstick/report_output/write_spec.rb