Sha256: fe97aa2103df1f413c125e669c0d8de0d53829fcdffd17517c041970d006b891

Contents?: true

Size: 433 Bytes

Versions: 76

Compression:

Stored size: 433 Bytes

Contents

# encoding: utf-8
require 'active_support/core_ext/string/inflections'

RSpec::Matchers.define :be_defined do
  match do |actual|
    begin
      actual.constantize

      return true
    rescue StandardError
      return false
    end
  end

  failure_message do |actual|
    "expected that #{actual} should be defined"
  end

  failure_message_when_negated do |actual|
    "expected that #{actual} should not be defined"
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.11.18 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.17 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.16 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.15 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.14 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.12 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.11 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.9 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.8 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.7 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.6 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.5 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.4 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.3 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.2 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.1 spec/matchers/is_defined.rb
fedux_org-stdlib-0.11.0 spec/matchers/is_defined.rb
fedux_org-stdlib-0.10.9 spec/matchers/is_defined.rb
fedux_org-stdlib-0.10.8 spec/matchers/is_defined.rb
fedux_org-stdlib-0.10.7 spec/matchers/is_defined.rb