diff options
author | Raphael Sofaer <raphael@joindiaspora.com> | 2011-04-12 01:38:00 +0400 |
---|---|---|
committer | Raphael Sofaer <raphael@joindiaspora.com> | 2011-04-12 01:52:21 +0400 |
commit | 080f08187d51a25c82e8235f56a3322be57c28b5 (patch) | |
tree | 78e37cc66915dc3abcf05cf619ca5f605a11bff8 /spec/support | |
parent | 8b4c8e77cb770b588c7cce2399761d54f325ea15 (diff) |
Disable typhoeus everywhere but the HTTPMulti specs
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/fake_typhoeus.rb | 22 | ||||
-rw-r--r-- | spec/support/stub_hydra.rb | 11 |
2 files changed, 22 insertions, 11 deletions
diff --git a/spec/support/fake_typhoeus.rb b/spec/support/fake_typhoeus.rb new file mode 100644 index 000000000..57b0d376f --- /dev/null +++ b/spec/support/fake_typhoeus.rb @@ -0,0 +1,22 @@ +class FakeHydra + def queue(*args); end + def run; end +end + +class FakeHydraRequest + def initialize(*args); end + def on_complete; end +end + +def disable_typhoeus + silence_warnings do + Job::HttpMulti.const_set('Hydra', FakeHydra) + Job::HttpMulti.const_set('Request', FakeHydraRequest) + end +end +def enable_typhoeus + silence_warnings do + Job::HttpMulti.const_set('Hydra', Typhoeus::Hydra) + Job::HttpMulti.const_set('Request', Typhoeus::Request) + end +end diff --git a/spec/support/stub_hydra.rb b/spec/support/stub_hydra.rb deleted file mode 100644 index e9d70861f..000000000 --- a/spec/support/stub_hydra.rb +++ /dev/null @@ -1,11 +0,0 @@ -#class Typhoeus::Hydra -# def initialize -# end - -# def queue(*args) -# end - -# def run -# end -#end - |