spec/spec_helper.rb in rhoconnect-4.0.4 vs spec/spec_helper.rb in rhoconnect-5.1.1

- old
+ new

@@ -1,9 +1,8 @@ require 'rubygems' require 'rspec' require 'webmock/rspec' -require 'rspec/autorun' # Required for Rcov to run with rspec '~> 2.8.0' require 'simplecov' require 'simplecov-rcov' SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter SimpleCov.start do @@ -54,14 +53,14 @@ ENV['RACK_ENV'] = 'test' ERROR = '0_broken_object_id' unless defined? ERROR class Rhoconnect::Model::Base - def inject_result(result) + def inject_result(result) @result = result end - + def inject_tmpdoc(doctype) @tmp_docname = doctype @stash_size = 0 end end @@ -142,11 +141,11 @@ def json_clone(data) JSON.parse(data.to_json) end def setup_post_yield(response) - RestClient.stub!(:post).and_yield(response, nil, nil) + RestClient.stub(:post).and_yield(response, nil, nil) end def set_state(state,append=false) state.each do |dockey,data| if data.is_a?(Hash) or data.is_a?(Array) @@ -343,10 +342,10 @@ klass.class_eval "def schema; end" end end def unzip_file(file,file_dir) - Zip::ZipFile.open(file) do |zip_file| + Zip::File.open(file) do |zip_file| zip_file.each do |f| f_path = File.join(file_dir,f.name) FileUtils.mkdir_p(File.dirname(f_path)) zip_file.extract(f, f_path) { true } end