Sha256: d485052d392c4112cc0a82a6a9255c5d38834471941628f1506a2d3f0b4fa2b0

Contents?: true

Size: 743 Bytes

Versions: 2

Compression:

Stored size: 743 Bytes

Contents

#!/usr/bin/env rspec
# Test that a client survives various error cases
require_relative "spec_helper"
require "dbus"

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

  context "when the bus name is invalid" do
    it "tells the user the bus name is invalid" do
      # user mistake, should be "org.ruby.service"
      expect { @bus.service(".org.ruby.service") }.to raise_error(DBus::Error)
    end
  end

  context "when the object path is invalid" do
    it "tells the user the path is invalid" do
      # user mistake, should be "/org/ruby/MyInstance"
      expect { @svc.object("org.ruby.MyInstance") }.to raise_error(DBus::Error)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-dbus-0.17.0 spec/client_robustness_spec.rb
ruby-dbus-0.16.0 spec/client_robustness_spec.rb