Sha256: 88e00e35ae021e088ea8ace1a20a24efa44811c336649dc429fd4bf27b17c27a
Contents?: true
Size: 921 Bytes
Versions: 5
Compression:
Stored size: 921 Bytes
Contents
# Copyright (C) 2008-2011 AMEE UK Ltd. - http://www.amee.com # Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details. require File.dirname(__FILE__) + '/spec_helper.rb' describe "AMEE module" do it "should cope if json gem isn't available" do # Monkeypatch Kernel#require to make sure that require 'json' # raises a LoadError module Kernel def require_with_mock(string) raise LoadError.new if string == 'json' require_without_mock(string) end alias_method :require_without_mock, :require alias_method :require, :require_with_mock end # Remove amee.rb from required file list so we can load it again $".delete_if{|x| x.include? 'amee.rb'} # Require file - require 'json' should throw a LoadError, # but we should cope with it OK. lambda { require 'amee' }.should_not raise_error end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
amee-3.2.1 | spec/amee_spec.rb |
amee-3.2.0 | spec/amee_spec.rb |
amee-3.1.2 | spec/amee_spec.rb |
amee-3.1.1 | spec/amee_spec.rb |
amee-3.0.1 | spec/amee_spec.rb |