File: bus_spec.rb

package info (click to toggle)
ruby-dbus 0.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 520 kB
  • sloc: ruby: 3,786; sh: 53; makefile: 8
file content (20 lines) | stat: -rwxr-xr-x 518 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env rspec
# Test the bus class
require_relative "spec_helper"

require "dbus"

describe "BusTest" do
  before(:each) do
    @bus = DBus::ASessionBus.new
    @svc = @bus.service("org.ruby.service")
    @svc.object("/").introspect
  end

  it "tests introspection not leaking" do
    # peek inside the object to see if a cleanup step worked or not
    some_hash = @bus.instance_eval { @method_call_replies || {} }
    # fail: "there are leftover method handlers"
    expect(some_hash.size).to eq(0)
  end
end