Class: Roby::Test::Assertions::FlexmockExceptionMatcher Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/roby/test/assertions.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Helper matcher used to provide a better error message in the various exception assertions

Deprecated assertions replaced by expect_execution collapse

Deprecated assertions replaced by expect_execution collapse

Instance Attribute Details

#matcherObject

Returns the value of attribute matcher

Returns:

  • (Object)

    the current value of matcher



413
414
415
# File 'lib/roby/test/assertions.rb', line 413

def matcher
  @matcher
end

Class Method Details

.describe=(flag) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



428
429
430
# File 'lib/roby/test/assertions.rb', line 428

def self.describe=(flag)
    @describe = flag
end

.describe?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


425
426
427
# File 'lib/roby/test/assertions.rb', line 425

def self.describe?
    @describe
end

Instance Method Details

#===(exception) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



414
415
416
417
418
419
420
# File 'lib/roby/test/assertions.rb', line 414

def ===(exception)
    return true if matcher === exception
    if self.class.describe? && (description = matcher.describe_failed_match(exception))
        Roby.warn  "expected exception to match #{matcher}, but #{description}"
    end
    false
end

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



421
# File 'lib/roby/test/assertions.rb', line 421

def inspect; to_s end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



422
# File 'lib/roby/test/assertions.rb', line 422

def to_s; matcher.to_s; end