Sha256: 7af923046d0652ffb5626aa931a5b8f2c820345c3fb21038f79323fef4bc2695

Contents?: true

Size: 633 Bytes

Versions: 51

Compression:

Stored size: 633 Bytes

Contents

require 'spec_helper'

describe RightSupport::Ruby::ObjectExtensions do
  context :require_succeeds? do
    it 'yields to its block when the require succeeds' do
      @canary = false

      # The 'set' source file ships with Ruby standard library and should
      # always be available
      if require_succeeds?('set')
        @canary = true
      end

      @canary.should == true
    end

    it 'does not yield when require fails for any reason' do
      @canary = false

      if require_succeeds?('a_source_file_with_a_wholly_improbable_name')
        @canary = true
      end

      @canary.should == false
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
right_support-2.11.3 spec/ruby/object_extensions_spec.rb
right_support-2.11.2 spec/ruby/object_extensions_spec.rb
right_support-2.10.1 spec/ruby/object_extensions_spec.rb
right_support-2.9.6 spec/ruby/object_extensions_spec.rb
right_support-2.9.5 spec/ruby/object_extensions_spec.rb
right_support-2.9.4 spec/ruby/object_extensions_spec.rb
right_support-2.9.3 spec/ruby/object_extensions_spec.rb
right_support-2.9.2 spec/ruby/object_extensions_spec.rb
right_support-2.9.1 spec/ruby/object_extensions_spec.rb
right_support-2.8.46 spec/ruby/object_extensions_spec.rb
right_support-2.8.45 spec/ruby/object_extensions_spec.rb
right_support-2.8.44 spec/ruby/object_extensions_spec.rb
right_support-2.8.43 spec/ruby/object_extensions_spec.rb
right_support-2.8.42 spec/ruby/object_extensions_spec.rb
right_support-2.8.41 spec/ruby/object_extensions_spec.rb
right_support-2.8.40 spec/ruby/object_extensions_spec.rb
right_support-2.8.39 spec/ruby/object_extensions_spec.rb
right_support-2.8.38 spec/ruby/object_extensions_spec.rb
right_support-2.8.37 spec/ruby/object_extensions_spec.rb
right_support-2.8.36 spec/ruby/object_extensions_spec.rb