similar to: Step matchers

Displaying 20 results from an estimated 20000 matches similar to: "Step matchers"

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 Sep 04
16
Failure Messages in RSpec
Having used JUnit and Test::Unit, I''m quite used to having the ability to insert a failure message, which helps when tests fail. For instance, the example RSpec that is generated for a model class specifies that the model class is valid. Assuming this were supposed to be true, and it failed, I''ve now got to duplicate the code in the test in order to find out why it
2007 Oct 16
12
Example for attr_accessible?
Is anyone out there writing specs to check attr_accessible fields? I had originally written my spec to check for allowing the desired fields, and then none of the other regular db fields. Unfortunately this isn''t satisfactory, because attr_protected could have been used instead, which of course wouldn''t prevent mass assignment to any whatever=(val) method. I''m thinking
2008 Nov 04
18
Can I do foo.should (be_nil || be_empty) in rspec
Is there any way to do foo.should (be_nil || be_empty) in rspec. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/ee43c9c9/attachment.html>
2007 Nov 12
15
it "should [action] ..." vs it with an active voice
I''d like to start gathering information/debating on the advantages/disadvantages of using it "should ..." vs other techniques. Dan North explained why we should use should: http://dannorth.net/introducing-bdd/ I used to use it "should ..." for the projects I was on, until I was challenged by a fellow developer who started using it with an active voice. For example
2007 Sep 14
2
Mocks in StoryRunner
Hi, I''m trying to get up and running with StoryRunner. I have a story that looks something like the following, but the call to mock_model produces the exception listed below. Am I just misunderstanding the concept? Are mocks not meant to be used in stories like this? Or is this a bug? Changing @user to be an actual AR object makes things run without error. ENV["RAILS_ENV"] =
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 Sep 27
3
There is a easy way to valid markup?
Do I have to create a custom Expectation Matcher? or there is a way to integrate assert_valid_asset plugin? thx -- Edgar Gonz?lez Gonz?lez --
2007 May 24
15
Specs for code stored in rails_app/lib/
Where should the specs go for code in the "lib" directory of a Rails app? I made a folder, "spec/lib/", for storing such specs, and RSpec automatically picks them up when run using "rake spec". Before I go ahead and patch rspec_on_rails/lib/autotest/ rails_rspec.rb so that autotest can monitor these specs I''d like to ask whether this is the
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
2007 Sep 07
12
Preconditions
Sorry, lots of questions these days. Is there a normal approach for preconditions? In JUnit, I might put a few assertions in the setUp() just to make sure that the test ''data'' I''ve created meets expectations before going to test it. So, for instance, I''ve got an object that is audited using acts_as_audited and I''d like to test the XML that results
2010 Nov 02
7
Testing attr_accessible (and/or attr_protected)
I''ve been puzzling over how to test that attr_accessible has been set for the correct columns; but the tests I''ve come up with so far seem to fail to fail when I expect. I came across this old message from this list: http://www.mail-archive.com/rspec-users at rubyforge.org/msg01570.html Which seemed like a plausible example, but my attempt (modeled on the example)
2008 Jun 03
9
Build rspec-rails as a gem?
I can''t figure out how to build rspec-rails as a gem when just cloned from github... there isn''t any .gemspec file or rake task that does this. Any help? -- Posted via http://www.ruby-forum.com/.
2007 Sep 19
1
Strange error in StoryRunner (was: Mocks in StoryRunner)
Hi, I''m posting this stack trace again because it keeps popping up, seemingly as the ''default error'' when something is wrong with my story code; for instance, I got it when I referenced a variable in my ''Given'' that I had forgotten to pass into the block. Now I''m getting it when I attempt to post to a login action: And ''user is
2007 May 21
4
Spec''ing redirect with arbitrary parameters
I''ve got the following expectation: response.should redirect_to(:action => "new", :video_id => "1", :process_id => "2", :origin_id => "3") that fails with this error message: expected redirect to {:video_id=>"1", :process_id=>"2", :origin_id=>"3", :action=>"new"}, got redirect to
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,
2009 Mar 19
6
[Cucumber 0.2] Failure to use should
I have a step definition like this: Then "the account should be created" do account = Account.find_by_name("my shiny new account") p account.class account.should_not be_blank end When running this step, I got the error message: Account(id: integer, name: string, state: string, next_renewal_at: date, created_at: datetime, updated_at: datetime, full_domain: string,
2008 May 27
4
Failing rspec story not causing a CruiseControl.rb build to fail?
We''ve just added rspec stories to our CruiseControl.rb build. When there''s a failing scenario we see the failure in the log output, but it doesn''t cause the CruiseControl build to fail. We''ve also just upgraded to the latest rspec version, 1.1.4, which fixes rspec bug 228, but the CC.rb build is still passing. Has anyone got failing rspec stories making
2007 Oct 15
4
Stories location
Should the stories dir be located on the project root? I was expecting to find it located under spec/ but there isn''t anything there, just the stories dir off of /. Also there don''t appear to be any rake tasks for stories, nor generators. Should there be any? Thanks, Steve
2008 Mar 17
8
should have_tag outside Rails
Hi Google has not helped me here. I''m looking for a way to use the have_tag assert_select wrapper outside RSpec on Rails (but in a Rails project) so I can use it to check text strings. Has anyone managed this? Thanks Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: