Using FxRuby and Test::Unit. 
Author Message
 Using FxRuby and Test::Unit.

I've been trying to write some code Test First using Test::Unit and FxRuby
and I'm having some problems.

Here is an example showing the problem I'm having.

///START///

require 'Test/Unit'
require "fox"

class TestClass < Test::Unit::TestCase      
        def set_up

        end    

        def test1      
        end            

        def test2
        end                    
end

///END///

Results in :

///START///

Loaded suite FoxProblemDemo
Started...
..FoxProblemDemo.rb:6: [BUG] Segmentation fault

abnormal program termination
ruby 1.6.6 (2001-12-26) [i586-mswin32]

Quote:
>Exit code: 3

///END///

The problem doesn't show up until the second test method is added. I'm
guessing that when set_up is called a second time a second application
object is create and that this is not allowed in Fox. I tried to get round
this by re-using the application object but this didn't help. I'm trying to
test a FXMainWindow sub-class and I get similar problems when I try to
instantiate a second instance using the same FXApp object.

Any have any pointers on how to use FXRuby and Test::Unit together would be
appreciated.

Rob Lally.



Sun, 12 Sep 2004 03:47:07 GMT  
 Using FxRuby and Test::Unit.

Quote:
> I've been trying to write some code Test First using Test::Unit and FxRuby
> and I'm having some problems.

<snip>

> Loaded suite FoxProblemDemo
> Started...
> ..FoxProblemDemo.rb:6: [BUG] Segmentation fault

> abnormal program termination
> ruby 1.6.6 (2001-12-26) [i586-mswin32]
> >Exit code: 3

> The problem doesn't show up until the second test method is added. I'm
> guessing that when set_up is called a second time a second application
> object is create and that this is not allowed in Fox. I tried to get round
> this by re-using the application object but this didn't help. I'm trying
to
> test a FXMainWindow sub-class and I get similar problems when I try to
> instantiate a second instance using the same FXApp object.

> Any have any pointers on how to use FXRuby and Test::Unit together would
be
> appreciated.

I'm just starting to look into this myself and so I don't have a "cookbook"
solution yet. But listed below is a test case I wrote for the FXButton class
that may give you some ideas. Note that it doesn't ever call create() to
actually create the server-side resources and display the GUI; it is
strictly testing the client-side data. I'm still not exactly sure how to
unit test GUI components like this, in an automated setting.

Anyways...

Hope this helps,

Lyle

require 'test/unit'

require 'fox'

include Fox

class TC_FXButton < Test::Unit::TestCase
  def set_up
    if FXApp.instance.nil?



    else


    end

  end

  def testText







  end

  def testStyle



















not work

  end

  def testState












  end
end



Sun, 12 Sep 2004 05:50:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. using test::unit for C++ unit tests

2. Test::Unit::Mock: Mock objects for testing with Test::Unit

3. Using Test::Unit to assert messages appeared on $stdout/$stde rr

4. Using Test::Unit to assert messages appeared on $stdout/$stderr

5. Unit testing - Using Java Mock Objects in Python?

6. Test order in Test::Unit

7. Test order in Test::Unit

8. Automating UI tests (was Re: Art of Unit Testing)

9. Unit testing data; What to test

10. Test Tool for Unit Tests?

11. Trouble Using FXRuby on cygwin/Windows NT

12. COM and unit tests

 

 
Powered by phpBB® Forum Software