source_position 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,3 +9,11 @@ end
9
9
  class Method
10
10
  include SourcePosition
11
11
  end
12
+
13
+ class UnboundMethod
14
+ include SourcePosition
15
+ end
16
+
17
+ class Proc
18
+ include SourcePosition
19
+ end
@@ -1,3 +1,3 @@
1
1
  module SourcePosition
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -5,6 +5,10 @@ class Dummy
5
5
  def self.foobar
6
6
  puts '42'
7
7
  end
8
+
9
+ def test
10
+ :testing
11
+ end
8
12
  end
9
13
 
10
14
  describe SourcePosition do
@@ -16,5 +20,20 @@ describe SourcePosition do
16
20
  subject { Object.method(:to_s) }
17
21
  its(:source_position) { should eq nil }
18
22
  end
23
+
24
+ describe 'Method' do
25
+ subject { Dummy.method(:foobar) }
26
+ its(:source_position) { should eq "#{Dir.pwd}/spec/source_position_spec.rb:5"}
27
+ end
28
+
29
+ describe 'UnboundMethod' do
30
+ subject { Dummy.instance_method(:test) }
31
+ its(:source_position) { should eq "#{Dir.pwd}/spec/source_position_spec.rb:9"}
32
+ end
33
+
34
+ describe 'Proc' do
35
+ subject { Proc.new{} }
36
+ its(:source_position) { should eq "#{Dir.pwd}/spec/source_position_spec.rb:35"}
37
+ end
19
38
  end
20
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_position
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-09 00:00:00.000000000 Z
12
+ date: 2012-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec