Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
[ANN] testy.rb - ruby testing that's mad at the world
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Brian Candler, post: 4635335"] Ah, now that's a really interesting way of thinking about examples/testing: in the form of an irb session. You can write your tests just by mucking about in irb, and when it makes sense, just paste the output somewhere. irb> foo = generate_foo => #<Foo:0xb7cd041c @attr1="hello", @attr2="world"> irb> foo.attr1 => "hello" irb> foo.attr2 => "world" Presumably you could avoid the fragile comparison on Object#inspect output by deleting it from the transcript. irb> foo = generate_foo ... irb> foo.attr1 => "hello" irb> foo.attr2 => "world" Writing something which parses that an (re)runs it to verify the output should be pretty straightforward. It can also handle the 'assert_raises' case nicely. irb> f.attr3 NoMethodError: undefined method `attr3' for ... Ara, how about it? :-) [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
[ANN] testy.rb - ruby testing that's mad at the world
Top