Skip to content

Instantly share code, notes, and snippets.

@masarakki
Created July 26, 2012 21:52
Show Gist options
  • Save masarakki/3184800 to your computer and use it in GitHub Desktop.
Save masarakki/3184800 to your computer and use it in GitHub Desktop.
fakefsとopen-uriの共存
# spec/spec_helper.rb
module FakeFS
module DefaultSettingHelper
def self.extended(example_group)
example_group.default_settings(example_group)
end
def self.included(example_group)
example_group.extend self
end
def default_settings(describe_block)
describe_block.before :each do
FakeFS::FileSystem.add File.expand_path('../../',__FILE__)
FakeFS::FileSystem.add File.expand_path '/tmp'
end
end
end
end
RSpec.configure do |config|
config.include FakeFS::SpecHelpers
config.include FakeFS::DefaultSettingHelper
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment