Sha256: e32686490dba9dbca4e185b69f53966966b16b2759eea699f2fbc8167514fe86

Contents?: true

Size: 603 Bytes

Versions: 3

Compression:

Stored size: 603 Bytes

Contents

require_relative 'helper_test'

subject 'capture standard output built-in matcher' do
  Spectus::Matcher::CaptureStdout.new "foo\n"
end

it 'must return the expected value' do
  expect { subject.instance_variable_get(:@expected) }.to eql: "foo\n"
end

it 'must match the captured standard output' do
  expect { subject.matches? { puts 'foo' } }.to equal: true
end

it 'must not match the captured standard output' do
  expect { subject.matches? { puts 'bar' } }.to equal: false
end

it 'must return the raised exception' do
  expect { raise subject.matches? { BOOM } }.to raise_exception: NameError
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spectus-1.0.1 test/spectus/matcher/built_in/test_capture_stdout.rb
spectus-1.0.0 test/spectus/matcher/built_in/test_capture_stdout.rb
spectus-1.0.0.pre test/spectus/matcher/built_in/test_capture_stdout.rb