~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to vendor/gems/mocha-0.5.6/test/execution_point.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mfrom: (1.1.8 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080726154345-c03m49twzxewdwjn
Tags: 0.24.5-2
* Fix puppetlast to work with 0.24.5
* Adjust logcheck to match against new log messages in 0.24.5
* Update standards version to 3.8.0 (no changes)
* Update changelog to reduce length of line to make lintian happy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class ExecutionPoint
 
2
  
 
3
  attr_reader :backtrace
 
4
 
 
5
  def self.current
 
6
    new(caller)
 
7
  end
 
8
  
 
9
  def initialize(backtrace)
 
10
    @backtrace = backtrace
 
11
  end
 
12
  
 
13
  def file_name
 
14
    /\A(.*?):\d+/.match(@backtrace.first)[1]
 
15
  end
 
16
  
 
17
  def line_number
 
18
    Integer(/\A.*?:(\d+)/.match(@backtrace.first)[1])
 
19
  end
 
20
 
 
21
  def ==(other)
 
22
    return false unless other.is_a?(ExecutionPoint)
 
23
    (file_name == other.file_name) and (line_number == other.line_number)
 
24
  end
 
25
  
 
26
  def to_s
 
27
    "file: #{file_name} line: #{line_number}"
 
28
  end
 
29
  
 
30
  def inspect
 
31
    to_s
 
32
  end
 
33
  
 
34
end