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.8.6 spec/matchers/is_defined.rb
fedux_org-stdlib-0.8.5 spec/matchers/is_defined.rb
fedux_org-stdlib-0.8.4 spec/matchers/is_defined.rb
fedux_org-stdlib-0.8.3 spec/matchers/is_defined.rb
fedux_org-stdlib-0.8.0 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.33 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.31 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.30 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.29 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.28 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.27 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.26 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.25 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.24 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.23 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.22 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.21 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.20 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.19 spec/matchers/is_defined.rb
fedux_org-stdlib-0.7.18 spec/matchers/is_defined.rb