Exception: Syskit::Test::NetworkManipulation::CannotStub

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/syskit/test/network_manipulation.rb

Instance Method Summary collapse

Constructor Details

#initialize(original, stub) ⇒ CannotStub

Returns a new instance of CannotStub



498
499
500
501
502
503
# File 'lib/syskit/test/network_manipulation.rb', line 498

def initialize(original, stub)
    @original = original
    @stub = stub
    @semantic_merge_blockers = @original.arguments.
        semantic_merge_blockers(@stub.arguments)
end

Instance Method Details

#pretty_print(pp) ⇒ Object



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/syskit/test/network_manipulation.rb', line 505

def pretty_print(pp)
    pp.text "cannot stub "
    @original.pretty_print(pp)

    pp.breakable
    if @semantic_merge_blockers.empty?
        pp.text "The reason is unknown. Consider this a Syskit bug"
        return
    end

    pp.text "The following delayed arguments should be made available"
    pp.nest(2) do
        @semantic_merge_blockers.each do |name, (arg, _)|
            pp.breakable
            pp.text "#{name} "
            pp.nest(2) do
                arg.pretty_print(pp)
            end
        end
    end
end