Forum: Ruby-Gnome 2 Callbacks not firing with Ruby/GTK inside of test cases?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8e594f28502d5f5951af5e0449a8c923?d=identicon&s=25 Marcus Crafter (Guest)
on 2006-04-10 05:20
(Received via mailing list)
Hi All,

Hope all is going well.

I've developed a simple GUI using Glade and are using the Ruby
libglade bindings (awesome stuff) to present the GUI to the user. At
this stage I've got a simple test case that using the
Test::Unit::TestCase base class and all it does is create the GUI and
wait for feedback.

The problem is that none of the callbacks work when you click on
buttons, etc. They need to be there otherwise the GUI won't be
created, but unfortunately I can't move onto any of the next screens
as the buttons activate but the callbacks aren't fired.

Is Ruby/GTK somehow incompatible/conflicting with the reflection
going on inside of Test::Unit::TestCase.

Has anyone else seen this behaviour as well? Any thoughts what might
be going wrong?

Cheers,

Marcus



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944...
1ba7514948bfec30a29598426c060963?d=identicon&s=25 Mathieu Blondel (Guest)
on 2006-04-10 05:35
(Received via mailing list)
Hi,

I think there was a similar issue a few mounths ago and the answer was
to use the "testrb" program instead of using "ruby" to run your tests.

Mathieu

Marcus Crafter a écrit :
> The problem is that none of the callbacks work when you click on
> Cheers,
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944...
> _______________________________________________
> ruby-gnome2-devel-en mailing list
> ruby-gnome2-devel-en@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ruby-...


--
Mathieu Blondel
http://www.mblondel.org
8e594f28502d5f5951af5e0449a8c923?d=identicon&s=25 Marcus Crafter (Guest)
on 2006-04-10 06:39
(Received via mailing list)
Hi Mathieu,

Thanks mate, I'm actually running the tests through Rake - presumably
that doesn't use testrb (or the same autorunner classes) internally?

Quite strange behaviour, I'll try it with testrb then. Thanks for the
tip.

Cheers,

Marcus
C0e0b0489d676615d8e7122018baf483?d=identicon&s=25 Daniel Hackney (Guest)
on 2006-04-10 06:42
(Received via mailing list)
For some strange reason, Ruby-GNOME2 needs to be loaded before
Test::Unit. If you just make sure that all require 'gtk2' statements
come before require 'test/unit', you should be fine. If you are
running tests using the Rake, you can do the following in the TestTask
definition:

  Rake::TestTask.new do |t|
    t.test_files = FileList['test/test*.rb']
    t.verbose = true
    t.ruby_opts << '-rgtk2'
  end

This will ensure that Ruby-GNOME2 is loaded before anything else. It
is a very silly problem which will hopefully be corrected in a future
release.
8e594f28502d5f5951af5e0449a8c923?d=identicon&s=25 Marcus Crafter (Guest)
on 2006-04-10 06:51
(Received via mailing list)
Hi Daniel,

Awesome mate, that was it - works fine now with the "t.ruby_opts << '-
rgtk2'" added to my Rakefile.

Thanks for everyone's help.

Cheers,

Marcus
9fe908f5593444a40be14a424c372e58?d=identicon&s=25 Masao Mutoh (Guest)
on 2006-04-10 16:39
(Received via mailing list)
Hi,

On Mon, 10 Apr 2006 00:40:46 -0400
"Daniel Hackney" <chrono325@gmail.com> wrote:

> For some strange reason, Ruby-GNOME2 needs to be loaded before
> Test::Unit.

The problem is both of Ruby/GLib and Test::Unit use "at_exit" to
run test scripts.

IMO, Test::Unit shouldn't use it because you can't run test
libraries/applications which use "at_exit".
#So you need to use testrb instead of ruby command.

If you interested in this issue, find this ML again.

> This will ensure that Ruby-GNOME2 is loaded before anything else. It
> is a very silly problem which will hopefully be corrected in a future
> release.

It may be silly, but I don't have another good idea.
So it won't be changed by me.
I hope you'll fix it and post your patch here ;).

--
.:% Masao Mutoh<mutoh@highway.ne.jp>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944...
This topic is locked and can not be replied to.