Outside-in BDD (with Specflow)

Declaritive is the proper way, IMO. If youre talking about page .aspx file names, you’re doing it wrong. The purpose of the story is to facilitate communication between developers and non-develoeprs. Non-developers don’t care about products.aspx, they care about a product listing. Your system does something the non-developers find value in. This is what you’re … Read more

Are BDD tests acceptance tests?

BDD “tests” exist at multiple different levels of granularity, all the way up to the initial project vision. Most people know about the scenarios. A few people remember that BDD started off with the word “should” as a replacement for JUnit’s “test” – as a replacement for TDD. The reason I put “tests” in quotes … Read more

How can I simulate the passing of time in Mocha tests so that setTimeout callbacks are called?

I found out that Sinon.JS has support for manipulating the JavaScript clock, via sinon.useFakeTimers, as described in its Fake Timers documentation. This is perfect since I already use Sinon for mocking purposes, and I guess it makes sense that Mocha itself doesn’t support this as it’s more in the domain of a mocking library. Here’s … Read more

Cucumber vs Capybara

Capybara is a tool that interacts with a website the way a human would (like visiting a url, clicking a link, typing text into a form and submitting it). It is used to emulate a user’s flow through a website. With Capybara you can write something like this: describe “the signup process”, :type => :feature … Read more

How to use RSpec without Rails?

The process is as follows: Install the rspec gem from the console: gem install rspec Then create a folder (we’ll name it root) with the following content: root/my_model.rb root/spec/my_model_spec.rb #my_model.rb class MyModel def the_truth true end end #spec/my_model_spec.rb require_relative ‘../my_model’ describe MyModel do it “should be true” do MyModel.new.the_truth.should be_true end end Then in the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)