bdd

TDD vs BDD in Rails 3?

Im a beginner when it comes to TDD and BDD. This is what I know: To use TDD in Rails I use it's built-in unit-, functional and integration tests. To use BDD in Rails I use Cucumber. So are these two different techniques that shouldn't be used together? If I use TDD, then I shouldn't use BBD/Cucumber and vice versa? Please enlighten...

DRY the SUT up - RSpec and Mocking question

n the .net world, my specs would follow the Arrange, Act, Assert pattern. I'm having trouble replicating that in rspec, because there doesn't appear to be an ability to selectively verify your mocks after the SUT has taken it's action. That, coupled with the fact that EVERY expectation is evaluated at the end of each 'It' block, is cau...

MSpec & Resharper test runner problem

I'm using MSpec and Visual Studio 2010 with Resharper 5.1. I've installed the MSpec test runner plugin into resharper but it's not working properly. Here's my test: public class when_I_click_create_investment_manager : with_main_window { Establish I_am_viewing_the_main_page = () => mainWindowViewModel = new MainWindowVie...

How to *automatically* test CSS rendering in different browsers (included Safari Mobile and Android Browser) ?

I'd like to know if there's programmatic, automatic, BDD-aware way to test how CSS is rendered in different browsers, just like Selenium can automatically test HTML and Javascript in different browsers. Integrating it with a BDD framework would be ideal. ...

SpecFlow / BDD Examples

Hi Folks, Just looking for some examples of BDD/SpecFlow - ideally a project so I can see how to use spec flow on big projects where multiple features my reference the same steps etc. I've read a few blogs over the last few months, but haven't had a nice, juicy project of someone else's to mooch around through. Cheers if you can help....

How to develop input object with TDD / BDD?

I have a method called ProcessPayment() that I'm developing via BDD and mspec. I need help with a new challenge. My user story says: Given a payment processing context, When payment is processed with valid payment information, Then it should return a successful gateway response code. To set up the context, I am stubbing my gateway ser...

Why use Mocks in Rspec?

I dont get why I should use Mocks in Rspec. If I write Specs, shouldn't I write the actual code afterwards so that the tests would pass? So why use Mocks and replace those actual classes? ...

Testing: Mock vs Stub?

I've read various articles about Mock vs Stub in testing, even the Fowler one. Also some threads here in the Stackoverflow. The answers are too difficult and abstract for me to understand. Could someone explain it in an Apple way? :) ...

What does regression test means?

Could anyone explain the word regression test in an understandable way? ...

Imperative and declarative steps in Rspec

I wonder what imperative vs declarative steps in Rspec is all about. Here is an example code from the Rspec book: Scenario: transfer money (declarative) Given I have $100 in checking And I have $20 in savings When I transfer $15 from checking to savings Then I should have $85 in checking And I should have $35 in savings Scenario: tran...

How to get VS2010 to recognize my mstests generated by SpecFlow?

I have configured Specflow to target the MsTest framework (instead of NUnit) by specifying it like this in the app.config of my 'specs' class library: <configSections> <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> </configSections> <specFlow> <unitTestProvider n...

related objects in steps with cucumber/pickle

Hi, it would be great if somebody could help me with the cucumber/pickle syntax on creating related objects and assert them. How can I get references in my cucumber syntax... Something Like For example: creating a blog post with a certain title with 3 comments And then assert this post and the related comments... Is this with object ...

Using Behaves_like<TBehavior> on a Base Class

I would like to specify a Behaves_like on a base specification to ensure that a particular method is marked as virtual. Something like this: public abstract class command_handler_context<TCommandHandler, TCommand> : abstract_context<TCommandHandler> where TCommandHandler : ICommandHandler<TCommand> where TCommand : ICommand...

How can I get Capybara @javascript tags executing correctly in Cucumber on a Rails 3 project?

I've swapped out Webrat for Capybara on a new Rails 3 project. I ran through Tim Riley's great post on it here ( http://openmonkey.com/articles/2010/04/javascript-testing-with-cucumber-capybara ), and also cloned his repository, executed the example cucumber feature, and saw the browser window fire open. So the whole Cucumber, Capybara, ...

How many use Rspec for controllers and views?

Are there strong reasons for using Rspec for controllers and views too? My views are heavily dependent on Javascript, and as far as I know, Rspec doesn't handle javascript/ajax on views. Also im using Cucumber + Selenium for that. And should I use it for controllers? Isn't it enough to just use Cucumber + Selenium for the application ...

Unit testing implies testing controllers/views too?

I want to understand exactly what unit test means. From what I have understood so far it implies testing a model and all its public methods. Is that correct? And what about controllers? Does unit test means testing the controllers/views too? Could someone enlighten me on this. ...

List all parts of a set in one Given-When-Then statement, or break out to separate specs?

When you write Given When Then specs, do you prefer to list elements in a set in 1 When statement, or do a separate spec for each? i.e. GIVEN a book WHEN category is "Fanatsy", "Sci-Fi", or "Horror" THEN Buy it. vs. GIVEN a book WHEN category is "Fanatsy" THEN Buy it. GIVEN a book WHEN category is "Sci-Fi" THEN Buy it. ...

Selenium vs Celerity?

Isn't Selenium better than Celerity when it comes to testing web sites cause real browsers like Firefox, Safari, Chrome and Internet Explorer could be used so that we know our website is compatible with each of them. So if I use Celerity (it's java browser), even if all tests pass, doesn't that mean my website could still be incompatibl...

BDD features of features, should I make a new story or it belongs in a scenario ?

Ok so I'm just starting to try and use BDD for some new development we are doing and I wrote up a story like this for a log viewer feature: Story: User reviews workflow execution logs As a user I want to review the log of rules execution So that I can examine the results and make adjustments/fixes to the rules definitions with some s...

Stories and Scenarios that implies UI

I am trying to learn how to use BDD for our development process and I sometimes end-up writing things that implies a UI design, so for brand new development or new features, the UI does not always exists. For example, if I say this in a scenario "When a column header is clicked" it implies that this feature is based on some sort of tabl...