spec/simplecov-lcov_spec.rb in simplecov-lcov-0.1.3 vs spec/simplecov-lcov_spec.rb in simplecov-lcov-0.1.4
- old
+ new
@@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require 'active_support/core_ext/kernel/reporting'
describe SimpleCov::Formatter::LcovFormatter do
describe '#format' do
let(:expand_path) {
lambda do |filename|
@@ -18,11 +19,13 @@
let(:simplecov_result) {
SimpleCov::Result.new(simplecov_result_hash)
}
before {
- SimpleCov::Formatter::LcovFormatter.new.format(simplecov_result)
+ @output = capture(:stdout) do
+ SimpleCov::Formatter::LcovFormatter.new.format(simplecov_result)
+ end
}
describe File do
it { expect(File).to exist(File.join(SimpleCov::Formatter::LcovFormatter.output_directory, 'spec-fixtures-hoge.rb.lcov')) }
it { expect(File).to exist(File.join(SimpleCov::Formatter::LcovFormatter.output_directory, 'spec-fixtures-app-models-user.rb.lcov')) }
@@ -35,9 +38,13 @@
let(:fixture) {
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-hoge.rb.lcov")
.gsub('/path/to/repository/spec', File.dirname(__FILE__))
}
it { expect(File.read(output_path)).to eq(fixture) }
+ end
+
+ describe STDOUT do
+ it { expect(@output).to include('Lcov style coverage report') }
end
end
describe '.output_directory' do
subject { SimpleCov::Formatter::LcovFormatter.output_directory }