Module: RSpecFixtures::Matchers

Defined in:
lib/rspec_fixtures/matchers/base.rb,
lib/rspec_fixtures/matchers/match_fixture.rb,
lib/rspec_fixtures/matchers/raise_fixture.rb,
lib/rspec_fixtures/matchers/output_fixture.rb

Defined Under Namespace

Classes: Base, MatchFixture, OutputFixture, RaiseFixture

Instance Method Summary collapse

Instance Method Details

#match_fixture(expected) ⇒ Object

Adds the matcher to RSpec: ‘expect(string).to match_fixture(file)`



7
8
9
# File 'lib/rspec_fixtures/matchers/match_fixture.rb', line 7

def match_fixture(expected)
  MatchFixture.new expected
end

#output_fixture(expected) ⇒ Object

Adds the matcher to RSpec: ‘expect { stream }.to output_fixture(file)`



5
6
7
# File 'lib/rspec_fixtures/matchers/output_fixture.rb', line 5

def output_fixture(expected)
  OutputFixture.new expected
end

#raise_fixture(expected) ⇒ Object

Adds the matcher to RSpec: ‘expect { something_that_errors }.to raise_fixture(file)`



5
6
7
# File 'lib/rspec_fixtures/matchers/raise_fixture.rb', line 5

def raise_fixture(expected)
  RaiseFixture.new expected
end