spec/spec_helper.rb in saber-1.0.0 vs spec/spec_helper.rb in saber-1.0.1

- old
+ new

@@ -1,40 +1,36 @@ +require "pd" require "saber" require "logger" $spec_dir = File.expand_path("..", __FILE__) -$spec_data = File.expand_path("../data", __FILE__) +$spec_data = File.join($spec_dir, "data") +$spec_tmp = File.join($spec_dir, "tmp") -Saber::Rc._merge! Optimism <<EOF +Rc = Saber::Rc +Rc._merge Optimism <<EOF p: home = Pa("#{$spec_data}/_saber") homerc = Pa("#{$spec_data}/_saberrc") - download = Pa("#{$spec_data}/download") + watch = nil + remote_watch = nil + fetcher_download = Pa("#{$spec_data}/download") + remote_download = Pa("#{$spec_data}/remote_bt") + download = Pa("#{$spec_data}/remote_bt") server: - download = Pa("#{$spec_data}/bt") ftp = "ftp://seedbox/bt" host = "localhost" user = "foo" -port = 8914 -token = "token" -drb_uri = "druby://localhost:8915" - # upload -p: - watch = nil - username = "username" bib: username = "bib-username" announce_url = "bib-announce_url" - -ptp: - announce_url = "ptp-announce_url" EOF $log = Logger.new(StringIO.new) require "thor" Saber.ui = Saber::UI::Shell.new(Thor.new.shell) @@ -44,11 +40,12 @@ c.cassette_library_dir = "spec/cassettes" c.hook_into :webmock end RSpec.configure do |config| - def capture(stream) + def capture(stream=:stdout) + require "stringio" begin stream = stream.to_s eval "$#{stream} = StringIO.new" yield result = eval("$#{stream}").string @@ -60,26 +57,27 @@ end alias :silence :capture end -module Kernel -private +module RSpec + module Core + module DSL + def xdescribe(*args, &blk) + describe *args do + pending + end + end - def xdescribe(*args, &blk) - describe *args do - pending "xxxxxxxxx" + alias xcontext xdescribe end end +end - def xcontext(*args, &blk) - context *args do - pending "xxxxxxxxx" - end - end - - def xit(*args, &blk) - it *args do - pending "xxxxxxxx" - end - end +def public_all_methods(*klasses) + klasses.each {|klass| + klass.class_eval { + public *(self.protected_instance_methods(false) + self.private_instance_methods(false)) + public_class_method *(self.protected_methods(false) + self.private_methods(false)) + } + } end