Module: Expectations::StateBasedRecorderForExpectationsWithoutBlock

Defined in:
lib/expectations/state_based_recorder_for_expectations_without_block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file.



3
4
5
# File 'lib/expectations/state_based_recorder_for_expectations_without_block.rb', line 3

def file
  @file
end

#lineObject

Returns the value of attribute line.



3
4
5
# File 'lib/expectations/state_based_recorder_for_expectations_without_block.rb', line 3

def line
  @line
end

Instance Method Details

#failure_messageObject



5
6
7
8
9
# File 'lib/expectations/state_based_recorder_for_expectations_without_block.rb', line 5

def failure_message
  "expected: <" +
    File.read(file).split("\n")[line.to_i - 1].strip +
    "> got: <#{subject} #{@message_parts.join(" ")}>"
end