One way would be to set an instance variable within your around
hook, as follows:
describe FileManipulatingClass do
around(:each) do |example|
Dir.mktmpdir do |dir|
@dir = dir
example.run
end
end
subject { described_class.new @dir }
context "given its help file exists" do
let(:file_path) { File.join @dir "help.txt"}
before(:each) do
File.open(file_path, 'w') {|io| io.write "some data" }
end
its(:help_text) { should eq("some data") }
end
end