Sha256: 2a76742db63b965f5e7f2a73e7a5dc16347b0bf6e11dfa1e166650fa5bd2fce3

Contents?: true

Size: 711 Bytes

Versions: 9

Compression:

Stored size: 711 Bytes

Contents

#!/usr/bin/env rspec
require_relative "spec_helper"
require "dbus"

describe DBus::Service do
  context "when a private bus is set up" do
    around(:each) do |example|
      with_private_bus do
        with_service_by_activation(&example)
      end
    end

    let(:bus) { DBus::ASessionBus.new }

    describe "#exists?" do
      it "is true for an existing service" do
        svc = bus.service("org.ruby.service")
        svc.object("/").introspect # must activate the service first :-/
        expect(svc.exists?).to be true
      end

      it "is false for a nonexisting service" do
        svc = bus.service("org.ruby.nosuchservice")
        expect(svc.exists?).to be false
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruby-dbus-0.17.0 spec/bus_driver_spec.rb
ruby-dbus-0.16.0 spec/bus_driver_spec.rb
ruby-dbus-0.15.0 spec/bus_driver_spec.rb
ruby-dbus-0.14.1 spec/bus_driver_spec.rb
ruby-dbus-0.14.0 spec/bus_driver_spec.rb
ruby-dbus-0.13.0 spec/bus_driver_spec.rb
ruby-dbus-0.12.0 spec/bus_driver_spec.rb
ruby-dbus-0.11.2 spec/bus_driver_spec.rb
ruby-dbus-0.11.1 spec/bus_driver_spec.rb