similar to: actual.should != not_expected

Displaying 20 results from an estimated 600 matches similar to: "actual.should != not_expected"

2006 Oct 17
0
new handling of equality
All, Based mostly on the earlier thread on "should_be", we have introduced a new branch called should_be_working_like_ruby with the new proposed handling for equality. Per the CHANGES file in that branch (rev 896): ============================================ IMPORTANT NOTE: THIS RELEASE IS NOT 100% BACKWARDS COMPATIBLE TO 0.6.x This release changes the way RSpec handles equality.
2006 Oct 24
2
1 should be 2. huh?
There''s another quirk I wanted to bring up. It''s about the failure message with should_equal and should_be. x.should_equal 2 a.should_not_be nil When they fail they yield messages like: 1 should equal 2 nil should not be nil When I''m caught off guard, which can be often, these messages confuse me. 1 should equal 2? No it shouldn''t. nil should not be
2006 Oct 16
2
subject.should_be true
As things stand now, the following will all pass: true.should_be true "true".should_be true "false".should_be true 3.should_be true etc My feeling is that "should_be true" should only pass if it returns boolean true even though ruby says that non-nil/non-false is true. Anybody else? David
2006 Sep 06
1
support for arbitrary comparisons
Mike Williams contributed a patch to support arbitrary comparisons. This is now in the trunk and will be part of the next release. So you will now be able to do this: result.should_be < 5 result.should_be >= 7 It also supports alternate syntax for should_be, should_match result.should == 3 result.should =~ /regex/ Personally, I prefer should_be and should_match in these cases, as I think
2006 Nov 19
2
underscores, sugar, and more and more bugs
I sent this earlier under with the subject "artificial sugar causes cancer" and I think some spam filters ate it. Here it is again: ====================================== All, If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149 you''ll see that Chad (the submitter) found the source of the bug. Unfortunately, the source
2006 Nov 19
6
artificial sugar causes cancer
All, If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149 you''ll see that Chad (the submitter) found the source of the bug. Unfortunately, the source of *this* bug is the *solution* to a *previous bug* in which Rails was replacing RSpec''s method missing with its own. When we settled on underscores, my one reservation was
2006 Sep 07
0
Dead easy Watir AND Selenium
Yesterday I added some Watir examples to RSpec''s svn. Today I added some Selenium (actually - Selenium Remote Control) examples. It''s dead easy to use both, and the Ruby code you end up writing is actually quite similar. Here''s a taste: == Watir == require File.dirname(__FILE__) + ''/rspec_watir'' context "Google''s search page" do
2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read about it at http://blog.caboo.se/articles/2006/06/13/a-better- assert_difference and to some it should look familiar -- you know who you are :), so I took a shot at one for rSpec on Rails. class Object def should_be_different(method = nil, difference = nil) return self.should_not_eql(yield) if method.nil?
2006 Dec 13
3
Testing has_many :through
I''m working with a has_many :through association, where a Member has_many Projects through ProjectViewers. The problem I''m running into is that Rails doesn''t load the association so line (3) fails until I explicitly access a member of the collection (in this case, I iterated it). Is there a better way? Thanks, Steve 1. assigns[:member].should_not_be_nil 2.
2007 Feb 15
1
Specs for RJS HTML output NOT containing an element
Hi I have an RJS template that renders a partial to update a page. I just added a parameter to get passed into this partial to eliminate a row in the table it generates, but I can''t find a way to test that the unwanted output is in fact missing. should(_not)_have_tag doesn''t work with RJS, and there''s no should_not_have from assert select. What
2006 Nov 08
1
controller.session not same as session?
> context "A user logging out" do > fixtures :users > controller_name :account > > setup do > login_as :quentin > users(:quentin).remember_me > request.cookies["auth_token"] = cookie_for(:quentin) > end > > def logout > get :logout > end > > specify "should unset :user in session" do
2008 Aug 20
9
I want RSpec for CSS layout.
I don''t even know how it''d be possible (through Selenium?), but I want it. I want to see if my stupid CSS hacks break. I want to say: describe "#nav-column" do body = something("#body-column") it "should line up at the top" do dom[:top].should_be == body.dom[:top] end it "should always be to the right" do
2006 Dec 31
2
what''s with the response.should_be_xxxx stacktrace?
If I do get :index response.should_be_success I get about 20k of marshalled dumpage that starts like #<ActionController::TestResponse:0x390443c @body=\"<html><body>You are being <a href=\"http://test.host/carts/1\">redirected</a>.</body></html>\", @assigns=[], @redirected_to={:action=>\"show\", :id=>1},
2007 May 09
4
UI testing framework? (w/o selenium)
Hey all, I am currently working on coming up w/ an easy to use, developer-centric web testing framework to test a J2EE app with. (I have 3 rails apps in production, love rspec, and am currently at a java shop). I''ve looked at selenium, and it just doesn''t seem like it is ready for prime time, and the target audience is developers. So, having said that, does the rspec
2007 Oct 16
6
RailsStory runner - empty response
I generated a new rails app then installed rspec and rspec_on_rails from trunk. I then created a sample story: require File.dirname(__FILE__) + "/helper" Story "View Home Page", %{ As a user I want to view my home page So that I can get a birds eye view of the system }, :type => RailsStory do Scenario "Publisher with no videos" do When
2012 Jun 14
3
response.should have_content("1 movie") does not seem to work for me
Hey everybody I have worked quite to near the end of The RSpec Book, but now I''m having some troubles. I''m trying to get the last few Cucumber steps to work, which are: Then /^Caddyshack should be in the Comedy genre$/ do visit genres_path click_link "Comedy" save_and_open_page response.should have_content("1 movie") response.should
2006 Oct 07
0
should_have_tag: What am I doing wrong?
My spec contains: response.should_have_tag "<legend>", :content => "Add new Contact" The output is: Spec::Expectations::ExpectationNotMetError in ''The ResourceController should do something when I try to edit contacts'' .. <legend>Add new Contact</legend> .. should include [[{:content=>"Add new Contact",
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running the following: should_render(:index) should_be_valid should_not_be_valid should_respond_to should_be should_render I thought the syntax changed to something like the following: obj.should render(:index) but this doesn''t seem to work. Scott
2007 Apr 11
10
DRYer controller specs
So, I''ve been following the recommendations for controller specs here: http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks Most notably: a single expectation per specify block; the setup block contains only stubs; mock expectations each get their own specify block. (I''m still using 0.8, so I haven''t gotten the describe/it goodness yet.) I
2007 Jul 26
5
Coding standards and whitespace
Recently as a result of using Git I''ve noticed a number of inconsistencies in the RSpec codebase with respect to whitespace (mixed line endings, mixed use of spaces and tabs for indentation, and trailing whitespace at the end of lines). I never would have noticed, but Git produces nice colorized diff output which highlights these kinds of inconsistencies. I wanted to ask if the