Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 5ce8240

Browse files
committed
Aruba has deprecated in_current_directory fix that
1 parent cc68276 commit 5ce8240

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

features/step_definitions/additional_cli_steps.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
end
9999

100100
Given /^I have a brand new project with no files$/ do
101-
in_current_dir do
101+
cd('.') do
102102
expect(Dir["**/*"]).to eq([])
103103
end
104104
end
@@ -115,7 +115,7 @@
115115
end
116116

117117
When "I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`" do
118-
in_current_dir do
118+
cd('.') do
119119
spec_helper = File.read("spec/spec_helper.rb")
120120
expect(spec_helper).to include("=begin", "=end")
121121

@@ -138,7 +138,7 @@
138138
end
139139

140140
When(/^I fix "(.*?)" by replacing "(.*?)" with "(.*?)"$/) do |file_name, original, replacement|
141-
in_current_dir do
141+
cd('.') do
142142
contents = File.read(file_name)
143143
expect(contents).to include(original)
144144
fixed = contents.sub(original, replacement)
@@ -151,7 +151,7 @@
151151
end
152152

153153
Given(/^I have not configured `example_status_persistence_file_path`$/) do
154-
in_current_dir do
154+
cd('.') do
155155
return unless File.exist?("spec/spec_helper.rb")
156156
return unless File.read("spec/spec_helper.rb").include?("example_status_persistence_file_path")
157157
File.open("spec/spec_helper.rb", "w") { |f| f.write("") }
@@ -230,7 +230,7 @@
230230
end
231231

232232
Given(/^I have changed `([^`]+)` to `([^`]+)` in "(.*?)"$/) do |old_code, new_code, file_name|
233-
in_current_dir do
233+
cd('.') do
234234
file_content = File.read(file_name)
235235
expect(file_content).to include(old_code)
236236
new_file_content = file_content.sub(old_code, new_code)

spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ def handle_current_dir_change
6666
ensure
6767
RSpec::Core::Metadata.instance_variable_set(:@relative_path_regex, nil)
6868
end
69+
70+
def in_current_directory(&block)
71+
# Arbua deprecated this helper but we use it all over the place
72+
cd('.', &block)
73+
end
6974
end
7075

7176
RSpec.configure do |c|

0 commit comments

Comments
 (0)