File: message_spec.rb

package info (click to toggle)
ruby-dbus 0.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 776 kB
  • sloc: ruby: 6,584; xml: 225; sh: 38; makefile: 8
file content (21 lines) | stat: -rwxr-xr-x 660 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env rspec
# frozen_string_literal: true

require_relative "spec_helper"
require "dbus"

# Pedantic full coverage test.
# The happy paths are covered via calling classes
describe DBus::Message do
  describe "#marshall" do
    it "raises when the object path is /org/freedesktop/DBus/Local" do
      m = DBus::Message.new(DBus::Message::SIGNAL)
      # the path is valid, it just must not be sent
      m.path = DBus::ObjectPath.new("/org/freedesktop/DBus/Local")
      m.interface = "org.example.spam"
      m.member = "Spam"

      expect { m.marshall }.to raise_error(RuntimeError, /Cannot send a message with the reserved path/)
    end
  end
end