search for: negative_failure_message

Displaying 8 results from an estimated 8 matches for "negative_failure_message".

2007 Jul 26
6
response.should_not redirect_to
...rces: # response.should_not redirect_to(url) # response.should_not redirect_to(:action => action_name) # response.should_not redirect_to(:controller => controller_name, :action => action_name) So, am I really missing something important? I''ve added negative_failure_message to RedirectTo matcher and it seems to function just fine (though as I''ve stated, it''s quite late over here, so I could be wrong) class Spec::Rails::Matchers::RedirectTo def negative_failure_message return %Q{expected to not to be redirected to # {@expected.inspect...
2007 Jan 27
1
should expectation syntax has changed
This is just a note in case anyone else is using the (I believe experimental) custom expectations. The custom expectation I had written used the custom ''met_by?'' function, which now appears to have been replaced by the ''matches?'' function to determine whether the expectation is met. Steve
2009 Mar 15
0
rspec 1.2.0 Released
...orted, so as long as you''re not monkey patching rspec''s built-in matchers, or using extension libraries that do, this should not affect you. If you run into trouble, you''ll just need to change: * failure_message => failure_message_for_should * negative_failure_message => failure_message_for_should_not * All references to rubygems have been removed from within rspec''s code. * See http://gist.github.com/54177 for rationale and suggestions on alternative approaches to loading rubygems * deprecations * BaseTextFormatter#colourize - use...
2009 Apr 02
8
Problem with Custom matcher and Blocks
...elector(''form#%s'' % [@id]) do |form| !@block or @block.call form end end def description "have a form with id #{@id}" end def failure_message "expected to have a form with ID #{@id}" end def negative_failure_message "expected not to have a form with ID #{@id}" end end def have_a_form_with_id id, &block HaveAFormWithID.new id, &block end end Sorry for all the code. Again this is my first custom matcher, so I could be doing something very wrong. Any help much ap...
2007 May 15
3
nested blocks
Hello, Does anyone have an explanation for why the following code results in the error that follows? I also would value any criticisms of my approach (i.e., defining it_should_populate_collections). Thanks -Chris #Code def it_should_populate_collections(condition=nil) it "should populate any necessary collections #{condition}" do [*@collections_to_populate].each do
2007 Jun 18
7
Testing for cross site scripting, etc.
Being new to testing and ruby, are there "standard" tests that can be done that test for things like cross site scripting and friends? If not, anyone have ideas on what I might do about testing those sorts of things? I''ll be using rails, also. Mike B. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging
2011 Jul 25
6
What does using a lambda in rspec tests accomplish?
Here is the code in question: describe UsersController do render_views … … describe "POST to ''create'' action" do describe "failure" do before(:each) do @attr = { :name => '''', :email => '''', :password => '''', :password_confirmation =>
2007 Jan 09
9
Date Approximation in Specs
The floating-point expectations allow for an error tolerance. Is there any similar facility for dates? For example, say I have a custom class that handles date/time spans and I want to spec it: context "A DateRange span" do specify "should know when a week ago is :)" do d = DateRange.new d.last_week.should_be_close_to(1.week.ago, 24*60*60) end end The idea