Class: Spec::Matchers::AutotestMappingMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/plugins/rspec/spec/autotest/autotest_matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(specs) ⇒ AutotestMappingMatcher

Returns a new instance of AutotestMappingMatcher.



4
5
6
# File 'lib/vendor/plugins/rspec/spec/autotest/autotest_matchers.rb', line 4

def initialize(specs)
  @specs = specs
end

Instance Method Details

#failure_messageObject



19
20
21
# File 'lib/vendor/plugins/rspec/spec/autotest/autotest_matchers.rb', line 19

def failure_message
  "expected #{@autotest.class} to map #{@specs.inspect} to #{@file.inspect}\ngot #{@actual.inspect}"
end

#matches?(autotest) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/vendor/plugins/rspec/spec/autotest/autotest_matchers.rb', line 13

def matches?(autotest)
  @autotest = prepare(autotest)
  @actual = autotest.test_files_for(@file)
  @actual == @specs
end

#to(file) ⇒ Object



8
9
10
11
# File 'lib/vendor/plugins/rspec/spec/autotest/autotest_matchers.rb', line 8

def to(file)
  @file = file
  self
end