Skip to content

Commit f759840

Browse files
committed
Update for latest rspec
1 parent fc17db7 commit f759840

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

Gemfile.lock

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ GEM
1616
activesupport (3.2.3)
1717
i18n (~> 0.6)
1818
multi_json (~> 1.0)
19-
addressable (2.2.7)
19+
addressable (2.2.8)
2020
aruba (0.4.11)
2121
childprocess (>= 0.2.3)
2222
cucumber (>= 1.1.1)
@@ -31,28 +31,27 @@ GEM
3131
rack-test (>= 0.5.4)
3232
selenium-webdriver (~> 2.0)
3333
xpath (~> 0.1.4)
34-
childprocess (0.3.1)
34+
childprocess (0.3.2)
3535
ffi (~> 1.0.6)
3636
coderay (1.0.7.rc1)
3737
crack (0.3.1)
38-
cucumber (1.1.9)
38+
cucumber (1.2.0)
3939
builder (>= 2.1.2)
40-
diff-lcs (>= 1.1.2)
41-
gherkin (~> 2.9.0)
40+
diff-lcs (>= 1.1.3)
41+
gherkin (~> 2.10.0)
4242
json (>= 1.4.6)
43-
term-ansicolor (>= 1.0.6)
4443
diff-lcs (1.1.3)
4544
fakefs (0.4.0)
4645
ffi (1.0.11)
47-
gherkin (2.9.3)
46+
gherkin (2.10.0)
4847
json (>= 1.4.6)
49-
httpclient (2.2.4)
48+
httpclient (2.2.5)
5049
i18n (0.6.0)
51-
json (1.6.6)
50+
json (1.7.3)
5251
libwebsocket (0.1.3)
5352
addressable
5453
mime-types (1.18)
55-
multi_json (1.2.0)
54+
multi_json (1.3.5)
5655
mustache (0.99.4)
5756
nokogiri (1.5.2)
5857
rack (1.4.1)
@@ -68,16 +67,16 @@ GEM
6867
rack-test (0.6.1)
6968
rack (>= 1.0)
7069
rake (0.9.2.2)
71-
rspec (2.9.0)
72-
rspec-core (~> 2.9.0)
73-
rspec-expectations (~> 2.9.0)
74-
rspec-mocks (~> 2.9.0)
75-
rspec-core (2.9.0)
76-
rspec-expectations (2.9.1)
70+
rspec (2.10.0)
71+
rspec-core (~> 2.10.0)
72+
rspec-expectations (~> 2.10.0)
73+
rspec-mocks (~> 2.10.0)
74+
rspec-core (2.10.0)
75+
rspec-expectations (2.10.0)
7776
diff-lcs (~> 1.1.3)
78-
rspec-mocks (2.9.0)
79-
rubyzip (0.9.7)
80-
selenium-webdriver (2.21.0)
77+
rspec-mocks (2.10.1)
78+
rubyzip (0.9.8)
79+
selenium-webdriver (2.21.2)
8180
childprocess (>= 0.2.5)
8281
ffi (~> 1.0)
8382
libwebsocket (~> 0.1.3)
@@ -87,9 +86,8 @@ GEM
8786
rack (~> 1.3, >= 1.3.6)
8887
rack-protection (~> 1.2)
8988
tilt (~> 1.3, >= 1.3.3)
90-
term-ansicolor (1.0.7)
9189
tilt (1.3.3)
92-
webmock (1.8.6)
90+
webmock (1.8.7)
9391
addressable (>= 2.2.7)
9492
crack (>= 0.1.7)
9593
xpath (0.1.4)

lib/rspec_api_documentation/dsl/endpoint.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@ def example_request(description, params = {}, &block)
1111
file_path = caller.first[0, caller.first =~ /:/]
1212

1313
location = caller.first[0, caller.first =~ /(:in|$)/]
14-
location = RSpec::Core::Formatters::BaseFormatter::relative_path(location)
14+
location = relative_path(location)
1515

1616
example description, :location => location, :file_path => file_path do
1717
do_request(params)
1818
instance_eval &block if block_given?
1919
end
2020
end
21+
22+
private
23+
# from rspec-core
24+
def relative_path(line)
25+
line = line.sub(File.expand_path("."), ".")
26+
line = line.sub(/\A([^:]+:\d+)$/, '\\1')
27+
return nil if line == '-e:1'
28+
line
29+
end
2130
end
2231

2332
def do_request(extra_params = {})

0 commit comments

Comments
 (0)