shoes / shoes4

Shoes 4 : the next version of Shoes
Other
1.59k stars 194 forks source link

Missing specs for swt/image.rb #365

Open davorb opened 11 years ago

davorb commented 11 years ago

There are a bunch of specs missing from swt/image.rb. Loading of remote images (download_and_display_real_image) isn't tested at all.

It might be a good idea to first have a look at 83c5531 before writing the tests.

PragTob commented 11 years ago

If you have any questions about this, please feel free to ask us - we'd love to help you get started with this =)

davorb commented 11 years ago

@PragTob Who are you talking to? :/

PragTob commented 11 years ago

@davorb haha sorry, was meant towards potential new contributors :-)

DaveCollinsJr commented 11 years ago

OK I'm taking a crack at this...

davorb commented 11 years ago

:+1:

PragTob commented 11 years ago

Thanks a lot! :-)

If you need some help/pointers/hints for this please let us know. Personally I'm pretty busy up until including this Sunday but there are also lots of other nice people around =D

DaveCollinsJr commented 11 years ago

I haven't forgotten about this... Just haven't had as much time as I thought to mess with it.

I've got it receiving the :download (at least directly, not with vcr_casettes yet) but having trouble asserting that the width and height are correct for nasa50th.gif.

Was hoping I could do something like this:

assert_equal 300, subject.real.image_data.width

but I get: undefined method `assert_equal' for #RSpec::Core::ExampleGroup::Nested_58::Nested_6:0x650908b5

..still playing...

PragTob commented 11 years ago

Hi there @DaveCollinsJr

we are using RSpec so the correct syntax would be: subject.width.should eq 300 (I believe as subject should be the image, we generally don't try to make assertions on attributes of real)

Hope that helps and thank you a lot for working on this :-)

Tobi

scottescue commented 10 years ago

Is this still a need? I see specs for drawing, painting, and dimensions but not much else. I'm looking for a place to jump in and start contributing. I welcome any updated suggestions on areas needing help.

jasonrclark commented 10 years ago

Hey @scottescue! Looking over the specs I think the original comments on this issue still hold--there isn't any testing of the image loading in any significant way.

I see a couple things/ways this could get tested:

To my eye those are probably in increasing order of the difficulty, but whatever catches your eye to add would be awesome!