Skip to content


Introduction to Acceptance Testing Ruby Web Applications

Last night I gave and recorded this presentation.


Ruby Acceptance Testing Introduction from Bryan Liles on Vimeo.

In this presentation, I demoed Cucumber and Webrat. I also talked about Integrity and how I like to put it all together.

Here are the slides if you are interested: acceptance testing in rails.pdf

Posted in Smarticus Speaks.


9 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Youssef says

    Thanks Bryan, just what i needed to get started with Cucumber. been postponing the transition for a while. and thanks for the introduction to the other technologies. good job

  2. aslakhellesoy says

    Awesome! I'll stick this on CukeTV as soon as I get to it.

    Aslak

  3. aslakhellesoy says

    You're right that Cucumber will load all step definitions even when you specify file:line to run a specific scenario. (Unless you also filter with –require). However, this is not slow. Loading a step definition just creates a few objects. What's slow is loading heavier things – like Rails.

  4. jose says

    Hi,
    nice talk. Seems the link to the slides is not available though. I would like to have the slides if possible

  5. sensei says

    I use cucumber, webrat and selenium daily… and this is a really bad illustration of how they work! The Line class isn't tested properly… and the “program” (ie the class) wouldn't work (at point 14:47). He's using key-lookups of a hash which is a Kernal instance variable which won't be accessible if the user goes to actually use the “feature” of the app.

    It's all over the place! Just a warning to beginners to be careful here… and to not give up if this is disheartening.

  6. bryanl says

    The code does work. Of course this isn't production ready code. The example here is the cucumber feature, not the ruby code. As written, everything is syntactically correct. When giving a 40 minute talk, you have to balance what you are trying to explain with the amount of completeness.


    class Line
    def initialize(a, b)
    @a,@b = a,b
    end

    def result
    Math.sqrt(
    (@b[:x].to_i-@a[:x].to_i)2 +
    (@b[:y].to_i-@a[:y].to_i)
    2
    )
    end

    private

    end


    As you can see here, the instance variables are created in the initializer. For brevity, I made the assumption that the points passed in were correct. If you were to use code like this in production, of course you would add in checks to see if things were correct. And you would also use a more robust Point class.

    Now, on to another thing. Everyone likes to complain on the internet. Before coming to someone's blog and creating a crazy invalid complaint, you should be sure to have your ducks in row.

    case 1. you blog is broken.

    <img src=”http://img.skitch.com/20090425-r8ki83du4juan7c3gcihmg33rp.png” />

    case 2. according to your web server error message everything you are using on your site is out of date. i would upgrade if i were you :)

    Thanks for watching my video!!!

  7. sensei says

    Sorry I rubbed you up the wrong way. That wasn't my intention.

    Your presentation confused me, and I'm fairly seasoned with Rails and Merb and I've been using the testing suite for a while. I wanted to warn total beginners not to give up heart if they were confused. Conversely, I found Ben Mabey's presentation to be quite clear… even though he was going at about 4 times as fast as any other presentation I've seen…

    I'm not in any way trying to be self-righteous, and I'm sorry if you didn't take my criticism as positive criticism.

    Re: your other points… Why is our industry so hell-bent on upgrading for the sake of it? If a tool does what I need, why should I “upgrade” it? If I like to use TextEdit to type my code, then why do I need to use a fully-blown IDE?

    Our server has got outdated versions of software on it, yes. Oh well :-) They work. Granted, the old copy of Merb that is running on switchpipe doesn't work too well all the time, but I'm in the process of migrating it over to a Rails app instead, so bear with me :-) It's down about once every couple of weeks for a few minutes here and there, and is pretty slow… until I've cross-graded it (should be happening in the next few weeks).

    Stay happy man! :)

    Sensei.

  8. melvinram says

    Hey man, good stuff. Keep up the good work. I really enjoyed your TATFT talk and was good too. Mabes talk was probably the best one on the subject so far but this re-enforced some ideas and added a couple new angles to think about.

  9. Типография says

    You're right that Cucumber will load all step definitions even when you specify file:line to run a specific scenario. (Unless you also filter with –require). However, this is not slow. Loading a step definition just creates a few objects. What's slow is loading heavier things – like Rails.



Some HTML is OK

or, reply to this post via trackback.

blog comments powered by Disqus


Blog WebMastered by All in One Webmaster.