Method: Messaging::Fixtures::Writer#call

Defined in:
lib/messaging/fixtures/writer.rb

#callObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/messaging/fixtures/writer.rb', line 40

def call
  context_name = "Write: #{message_class.message_type}"

  context context_name do
    if test_block.nil?
      raise Error, "Write fixture must be executed with a block"
    end

    detail "Message Class: #{message_class.inspect}"

    written = !message.nil?

    test "Written" do
      if not written
        detail "Remaining message tests are skipped"
      end

      assert(written)
    end

    return if not written

    test_block.call(self)
  end

  message
end