Displaying 20 results from an estimated 20000 matches similar to: "it "should [action] ..." vs it with an active voice"
2007 Oct 21
18
plain text stories
Thanks to discussions on this list, suggestions from many of you and a
patch from Pat Maddox, we now have Plain Text User Stories in Story
Runner.
Read more:
http://blog.davidchelimsky.net/articles/2007/10/21/story-runner-in-plain-english
Cheers,
David
2007 Aug 24
26
testing behaviour or testing code?
hypothetical question for all you BDD experts:
I want to make sure that a :list action always returns widgets in
alphabetical order. There''s at least 2 ways of doing this:
it "should fetch items in alphabetical order" do
Widget.should_receive(:find).with(:order => "name ASC")
get :list
end
it "should fetch items in alphabetical order" do
[:red,
2007 Oct 14
40
Step matchers
I think we all know that the readability of steps isn''t great right
now, and in fact there''s a very recent thread that discusses just
that. It was that recent thread that prompted me to explore this a
bit.
The basic idea is that you define step matchers, which have a regex,
and then you match step names against that regex. Kind of tough for
me to explain so I''ll just
2008 Mar 04
9
What is your workflow? Or how to use the story runner the right way.
I really would like to know how people are using the Story and Example
runner to write their software.It would be great to get some direction on
it, because I think I''m missing some points.
Taking the outside-in approach in thought:
At first we write a high-level customer-facing story, this story fails.
Then we start using mocks at object level to use them as a design tool,
and so we
2008 Jan 11
13
Role of stories vs specs, revisited
A couple months ago I asked how stories and specs might impact each
other. [1] If you look at Dan North''s example of what''s in a story
[2], and you imagine using the spec framework to drive the design, you
can probably imagine a significant bit of overlap in the two. Is that
a bad thing? I''m not sure. It has made me a bit uncomfortable
though, and I''ve
2007 Mar 24
15
State Based vs. Behaviour Based Spec/Testing
I''ve notice that a project like Rubinius has both a spec & a test
directory. Rspec has only a spec directory. Obviously I support
BDD, but isn''t there also a place for state based/verification
testing? I sometimes sense that I *do* want to practice Test Driven
Development. That is, I want some assurance that my production code
will run as intended. But I also
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives
2007 Oct 18
12
first cut at blockless given/when/then
Hi all,
I committed a first cut at blockless Givens/Whens/Thens to RSpec''s trunk:
cd /path/to/rspec/project
svn up
cd rspec
bin/spec examples/story/calculator.rb
Take a look at examples/story/calculator.rb to see what''s going on.
Needs docs!!!!
Thoughts welcome.
I''ve also got a cut at the plain text parser checked in, but it''s not
hooked up to anything
2007 Oct 17
15
Any tips on teaching BDD with RSpec?
Hi
I hope this is not OT. I''m training my replacement at work to do BDD
Rails development. He''s done a CS/maths degree but has no
professional programming experience, so he''s never NOT done a project
without BDD. In a way I am jealous of his unspoilt situation :)
I''ve gone about things this way:
* first teach him some Ruby (he did mainly Java at
2007 Sep 04
7
Rake tasks getting in the way of edge (uses gem instead)
So I''d been running gem releases of rspec for the past several months,
and I installed edge rspec so that I can use Story Runner.
I''m running into a problem because I''ve got a couple rake tasks that
reference "spec/rake/raketask". If I try to run "rake spec" then it
pulls in the gem version instead of the plugin version. rake blows up
saying that
2007 Apr 09
7
RCov results seem to include the spec files
I saw the RCov page at http://rspec.rubyforge.org/tools/rcov.html and
decided to add it to my project. My rakefile looks like this:
require "rake"
require "spec/rake/spectask"
desc "Run all specs with RCov"
Spec::Rake::SpecTask.new("spec:rcov") do |t|
t.spec_files = FileList["spec/**/*_spec.rb"]
t.rcov = true
end
When I run rake spec:rcov,
2007 Sep 03
20
Reason for _spec.rb convention
Hi
Easy one - I just wondered why all spec files for rspec_on_rails end
"_spec.rb" instead of just ".rb"? They are all inside the spec
folder so surely the fact they are specs is implicit?
Ashley
2007 May 21
4
Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which
looked like
specify "should render abc123" do
controller.should_render :text => "abc123"
get :key
end
With 1.0.0, the new spec is
it "should render abc123" do
get :key
response.should render_text("abc123")
end
However it doesn''t work, giving me the error:
undefined
2008 Jan 11
9
Varying test data
This isn''t specific to RSpec, but is hopefully on-topic for this list.
I like (especially when "ping pong pairing") to write a spec, then
write the smallest amount of code I can to pass it (especially when
"ping pong pairing"). Sometimes this means hard-coding a return value,
which means another spec is needed to prove that the code is really
behaving as it
2007 Sep 03
6
blog post on story runner
Here''s an excellent blog post on Story Runner, which will be part of
the next release and is undergoing active development in trunk:
http://evang.eli.st/blog/2007/9/1/user-stories-with-rspec-s-story-runner
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful
controller (well, aren''t all RESTful controllers simple? :)
I''ve created a couple spec helper methods to refactor some of the
common code...for example, require_login_and_correct_user creates two
specifications: one for when the user isn''t logged in, and one when
the user is logged in but
2007 Dec 14
13
RSpec-1.1.0 is released
The RSpec Development Team is pleased as glug (that''s kind of like
punch, but more festive) to announce RSpec-1.1.0.
Thanks to all who have contributed patches over the last few months.
Big thanks to Dan North and Brian Takita for their important work on
this release. Dan contributed his rbehave framework which is now the
Story Runner. Brian patiently did a TON of refactoring around
2007 Nov 13
5
Role of stories vs specs
I''ve been thinking about the role that stories played compared to
specs, and that "should we use should" thread brought those thoughts
up again.
First I want to discuss whether or not specs are authoritative
regarding the desired behavior of a system. I would say they''re a
good approximation of how the system currently runs according to the
developer''s
2007 Oct 13
13
Story Runner: Readability of output with multiple params
Fistly, many, many thanks for RSpec and Story Runner.
Minor request to improve readability of output
Given a scenario item with multiple params..
Eg. And "the user belongs to", "Joe", "Acme" do |user_name, company_name|
The readability of the following output is less than ideal..
"And the user belongs to company,Joe Public, No Videos"
It would be
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful