File: bus_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 (22 lines) | stat: -rwxr-xr-x 549 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
22
#!/usr/bin/env rspec
# frozen_string_literal: true

# 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