File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def define_shortcut_methods
102102 # creates a shortcut function that forwards each call to the method on
103103 # the appropriate intf
104104 singleton_class . class_eval do
105- define_method name do |*args , &reply_handler |
105+ redefine_method name do |*args , &reply_handler |
106106 intf . method ( name ) . call ( *args , &reply_handler )
107107 end
108108 end
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env rspec
2+ require_relative "spec_helper"
3+ require "dbus"
4+
5+ describe DBus ::ProxyObject do
6+ around ( :each ) do |example |
7+ with_private_bus do
8+ with_service_by_activation ( &example )
9+ end
10+ end
11+
12+ let ( :bus ) { DBus ::ASessionBus . new }
13+
14+ context "when calling org.ruby.service" do
15+ let ( :svc ) { bus [ "org.ruby.service" ] }
16+
17+ context "when introspection mode is not specified" do
18+ describe "#bounce_variant" do
19+ it "works without an explicit #introspect call" do
20+ obj = svc [ "/org/ruby/MyInstance" ]
21+ ifc = obj [ "org.ruby.SampleInterface" ]
22+ expect ( ifc . bounce_variant ( 42 ) ) . to be_eql 42
23+ end
24+
25+ it "works with one #introspect call" do
26+ obj = svc [ "/org/ruby/MyInstance" ]
27+ obj . introspect
28+ ifc = obj [ "org.ruby.SampleInterface" ]
29+ expect ( ifc . bounce_variant ( 42 ) ) . to be_eql 42
30+ end
31+
32+ it "works with two #introspect calls" do
33+ obj = svc [ "/org/ruby/MyInstance" ]
34+ obj . introspect
35+ obj . introspect
36+ ifc = obj [ "org.ruby.SampleInterface" ]
37+ expect ( ifc . bounce_variant ( 42 ) ) . to be_eql 42
38+ end
39+ end
40+ end
41+ end
42+ end
You can’t perform that action at this time.
0 commit comments