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: transfer money (imperative)
Given I have $100 in checking
And I have $20 in savings
When I go to the transfer form
And I select "Checking" from "Source Account"
And I select "Savings" from "Target Account"
And I fill in "Amount" with "15"
And I press "Execute Transfer"
Then I should see that I have $85 in checking
And I should see that I have $35 in savings
I don't quite get the picture.
What I have understood is that declarative let you do whatever you want as long as the result passes, and imperative is more verbose.
However, I don't feel that I have got the point of this.
Could someone explain this a little bit more. What are the differences and which one should I choose?