elight / coulda Goto Github PK
View Code? Open in Web Editor NEWGiven-when-then for Test::Unit (or "If shoulda and cucumber had a baby")
Home Page: http://coulda.tiggerpalace.com
License: Other
Given-when-then for Test::Unit (or "If shoulda and cucumber had a baby")
Home Page: http://coulda.tiggerpalace.com
License: Other
Scenario "Query with no query args returns all locations" do
given_a_person
given_im_logged_in_as :person
And "A job with a maximum of zero agents"
end
Removing the pending "And" causes it to run without error.
I may have this fixed in my local version of coulda but seems to be broken in 0.6.3. Or, at least, in a Feature that has a pending Scenario and one or more implemented Scenarios.
Hi there,
It seems 0.7.1 is not backwards compatible with the last version of coulda, as once I upgraded it could no longer find any of the methods I was calling from inside any Given
, When
, And
, and Then
block.
Is there a new way if defining methods that can be shared within a Feature?
Thank you.
We discussed this at DCamp: essentially, allow for something like:
Given :logged_in_as_admin
...
To work, and the symbol would fire a method of the same name. This would also be a no brainer for the pretty test runner output, "Given logged in as admin".
If you are using something like Timecop, it would be especially helpful if there was a way to ensure Time.reset is called.
The below example results in a NameError:
require 'rubygems'
require 'coulda'
include Coulda
Feature "Painfully obvious" do
in_order_to "demonstrate a simple test"
as_a "coulda developer"
i_want_to "provide a straight-forward scenario"
def given_something_without_a_value
Given "something without a value" do
@no_value = nil
end
end
Scenario "Describing something obvious" do
given_something_without_a_value
When "I give it a value" do
@no_value = true
end
Then "it should have a value" do
assert(@no_value)
end
end
end
I'm a newbie of BDD and it would be great to read a tutorial on how to use it. Even a very simple program would be ok.
Looking at the example, I don't know how to verify the expectations...
The below currently fails.
Feature "feature name" do
in_order_to "foo"
as_a "bar"
i_want_to "blech"
def given_a_macro
Given "a method that calls Given" do; end
end
Scenario "that is live" do
given_a_macro
When "bar" do; end
Then "blech" do; end
end
end
nt
It'd be super sexy if I could specify a specific scenario to run within a Could test (and have it only run that code).
Is it possible to use coulda + webrat +rspec2 with rails3..
Since there is a long way for cucumber to support rails3 yet, coulda as being cucumber-lite will be perfect for our internal projects
'nuff said.
I really like the simplicity of what you have going here. And I'm about ready to choose coulda over cucumber.
That said, tt was mentioned somewhere that you were not going to implement fit tables as they could be supported in given clauses. That may be true, but what about using tables for scenario outlines. These handy little guys could save a ton of cut and pasting. Or am I missing a better way to do something?
See related link.
http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.