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



570
571
572
# File 'lib/roby/test/assertions.rb', line 570

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.



595
596
597
# File 'lib/roby/test/assertions.rb', line 595

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)


591
592
593
# File 'lib/roby/test/assertions.rb', line 591

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.



571
572
573
574
575
576
577
578
579
580
# File 'lib/roby/test/assertions.rb', line 571

def ===(exception)
    return true if matcher === exception
    return false unless self.class.describe?

    if (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.



582
583
584
# File 'lib/roby/test/assertions.rb', line 582

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.



586
587
588
# File 'lib/roby/test/assertions.rb', line 586

def to_s
    matcher.to_s
end