bdd

BDD and functional tests

I am starting to buy into BDD. Basically, as I understand it, you write scenario that describes well acceptance criteria for certain story. You start by simple tests, from the outside-in, using mocks in place of classes you do not implement as yet. As you progress, you should replace mocks with real classes. From Introduction to BDD: ...

Which testing tools do what in Ruby?

What I mean by that is, which tools are for unit testing, which for BDD, is there even a clear divide? I'm just learning Ruby from C#, and the tools I'm familiar with there are xUnit-style for pure unit testing/TDD, and Cucumber/SpecFlow for BDD/integration testing. Of course, you can use unit testing tools for integration testing if y...

Silencing cucumber stack trace

Does anybody know how to silence or filter lines from the backtrace of a cucumber run? Im running a rails 2.3.5 App with the database_cleaner plugin set to truncate after each scenario. And every time one runs, the terminal gets flooded with useless "NOTICE truncate cascades.. blah blah" message. I've tried using the config/initializers...

Rails 3 Autotest is saying "command not found", any ideas?

Hi... I've been trying to setup autotest with rails 3 beta4 but I getting a "-bash: autotest: command not found" -- any ideas? I installed it by putting the gem in my gemfile and then doing a bundle install.. ...

Cucumber Scenarios Failing Without Error Message

I'm getting Rails and Cucumber going on my Mac OS X box. When I try to run the following scenario: Feature: ActorDetail In order to learn about an actor As a costumer I want to see their details Scenario: Actors page should exist Given I am on actor page Then I should see "Actors" When I attempt to run the tests I get the foll...

Using BDD style of tests

Hi, When using BDD for higher level of tests, then this language in tests - given,when,then seems easy to understand.I am using C#.So,what I do is name the class as "whenthishappens",setup is the "given",and then I have tests.But,how to use this style of BDD when writing tests for a class method.Or,should I have just tests named "should...

rails tests confusion

I have been trying to determine a good way to test rails apps, covering all relevant aspects... since I have no experience writing tests at all I have been looking at railscasts.com which seems like a pretty good resource to learn basic stuff for rails. but for tests I have found several episodes, some using rails unit test classes, othe...

Is it better to specify all the parameters of a given in one line, or each parameter on a seperate line?

Is it better to specify all the parameters of a given in one line, or each parameter on a seperate line? i.e. which is better? seperate And for each parameter Scenario: some random scenario Given a menu with a menu width of 19 And quit text of "quit" And Fruit options of |Text| |some text| When ... Then ... or ...

BDD, what's a feature?

I'm just starting with BDD and I'm trying to build a small app, so I can see it working in a real environment, but I'm having trouble deciding what should be a feature. I'm building a tiny shop. I decided that "Compare products" will be a feature and "User can checkout as guest" will be one, but to get to that, I first need to list prod...

authlogic flash[:notice] does not show up in cucumber webrat step

Hi, I am running BDD steps with cucumber to implement my autlogic login behavior. Scenario: log in Given a registered user: "[email protected]" with password: "p@ssword" exists And I am on the homepage When I follow "Log in" And I fill in "Username" with "[email protected]" And I fill in "Password" with "p@ssword" And I open the page And I pre...

Developing XSLT with TDD/BDD

I've been assigned the task of creating an XSLT transform on an XML dump from a database. Being a believer of Test/Behavior Driven Development I was wondering if anyone has attempted it before or has advice about how to go about it. My gut reaction is to test this 'black box' with rspec. Is there a unit testing framework out there f...

Using Specflow scenarios for both intergration tests and unit tests

I've just come across BBD and specflow and it looks very interesting. When writing user stories they are typically on a high-level and the actor users the GUI. So when writing scenarios they will typically be GUI test or integration test from a high level of the system. But what about unit test further down in the solution? E.g. service ...

How to approach implementing an interface in a TDD way

So I'm trying to convert myself to a more test- and behaviour- driven approach to my development. It's good for me, and I've seen good results in the few projects I've used it for so far. My current project is a FUSE-based filesystem - I want to add some functionality over basic filesystem access so FUSE seemed like a good fit. All I ...

How can I test one, more or none images in a page with Cucumber?

I want to test if I have 0, 1, 2 or 3 times a pictures ('foo.png') in a certain page with Cucumber. How should I write the custom step? Thanks ...

How can I test with a certain word is a link or not with Cucumber?

I would like this custom step: Then I should see the link 'foo' and his opposite: But I should not see the link 'foo' In the page I can have something like: lorem foo bar or alternatively lorem <a href=''>foo</a> bar I need to test when 'foo' is a link and when isn't. Thank you. ...

How should I implement this specflow step?

Okay, I've decided to try and get to grips with the whole TDD process from start to finish. I'm writing a simple blog in ASP.NET MVC 2 Application and have started with doing acceptance tests to test my fetaures as I implement them. I'm using SpecFlow as my BDD/ATDD framework. I've been reading "Growing Object Orientated Systems Guid...

Rails Cucumber access to controller variables

Hi, I've a controller that defines the @projects variables to be displayed in the view. There is any way to access to that projects in the cucumber step? Note that this variables contains the paginated results, the idea is to test if the values are being displayed in the page. I've tried to access the variable through assigns and cont...

ATDD versus BDD and the proper use of a framework

I am just getting into the concept of BDD and have listened to Scott Bellware's talk with the Herding Code guys. I have been playing around with SpecFlow some and like it pretty well. I understand the distinction between ATDD and TDD as described in the blog post Classifying BDD Tools (Unit-Test-Driven vs. Acceptance Test Driven) and a...

SpecFlow / BDD with ASP.NET MVC

Hi Guys and Gals, I'm new to BDD, and using SpecFlow I'm trying to work out an efficient, organised, and maintainable methodology(for use within ASP.NET MVC). The main areas I need to improve on are: Grouping of steps (into step files) Reusing test objects (like it is so easy to in unit tests by inheriting test base classes etc) Folde...

Handling Async With Specflow for Silverlight

The Silverlight Unit test Framework defines a process for dealing with Async calls (derive test class from Microsoft.Silverlight.Testing.SilverlightTest, add Asynchronous attribute, use EnqueueXXX methods.) Considering the separation that SpecFlow presents between the test class and the steps: Can these tools be brought to bear to wai...