Sha256: d1473cc1c13c39e4ca9e7057b66b919edd017ff546eb54cd8713abf6055691d4

Contents?: true

Size: 914 Bytes

Versions: 1

Compression:

Stored size: 914 Bytes

Contents

require File.join(File.dirname(__FILE__), 'rails', 'spec_helper')

unless RUNNING_RAILS
  require File.join(File.dirname(__FILE__), '..', 'spec_helper')
  
  describe "when rails is loaded, but is not a supported version" do
    module MockRails
      module VERSION
        STRING = ::Markaby::Rails::UNSUPPORTED_RAILS_VERSIONS.first
      end
    end
    
    def install_mock_rails
      Object.const_set(:Rails, MockRails)
    end
    
    def remove_mock_rails
      Object.class_eval do
        remove_const(:Rails)
      end
    end
    
    before do
      install_mock_rails
    end
    
    after do
      remove_mock_rails
    end
    
    it "should raise" do
      lambda {
        ::Markaby::Rails.load
      }.should raise_error(LoadError, "Cannot load markaby under rails version 2.0.0.  See Markaby::Rails::SUPPORTED_RAILS_VERSIONS for exactly that, or redefine this constant.")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Markaby-0.6.5 spec/markaby/rails_version_spec.rb