similar to: How to keep mocks consistent?

Displaying 20 results from an estimated 10000 matches similar to: "How to keep mocks consistent?"

2007 May 24
9
Mocking, changing method interfaces and integration tests
Suppose we have a method ''foo'' which internally uses another method ''bar''. Being good BDDers we mock out the ''bar'' method. After all, we only want to spec the ''foo'' method - actually running the ''bar'' method means slower, less maintainable and brittler specs. That''s why we <3 mocking,
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 Aug 28
3
How do you keep mocks updated without pain?
Hi! I know you must be answering a lot of basic questions, sorry about that :-) However I have not get it, how do you keep mocks updated without pain? I reached to the point where mocking things for view. I spec model-controller-view using "correct doc" way mocking-stubbing (plus I should run integration test to be sure that everything really works together). Now, when I want to
2012 Mar 07
6
Can't find the PostgreSQL client library (libpq)
When i try it start my ruby server i get a error that looks like rails server Could not find pg-0.12.2 in any of the sources Run `bundle install` to install missing gems. I dont know what to do Thanks for all the help -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2010 Oct 25
2
Fail to load spec/rake/spectask
Hi! I''m a newbie at Ruby. I''m trying to run rspec tests using rake. In my rake file I include spec/rake/spectask. It fails to load giving me the following message: rake aborted! no such file to load -- spec/rake/spectask C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'' I''m using version 1.8.7 of Ruby. I have installed rake
2007 May 30
4
Using mocks
I''ve just started doing TDD/BDD and like the idea of mocks. So I set out to use them. The doc pages seem great, I setup the mock and then it just works. Here is what I am trying to do: Myuser is a non-rails model of user attributes. We are going to be mocking the connection to the ldap server. The user class has a login method that connects to the ldap server and if successful,
2007 Feb 17
1
"warning: object#id will be deprecated" with mocks
hi all I have the following code in a spec: @user = mock("user") User.stub!(:authenticate).and_return(@user) @user.should_receive(:id).once.and_return(99) post :login, {:username => ''username'', :password => ''password''} session[:user_id].should == 99 it works as expected but I get the following warning when I run the spec: warning:
2007 Jan 08
2
thoughts on mocks and specs
I spent the last couple of days getting my sea legs with Rails and RSpec. I''d been waiting til things seemed calmer before jumping in, and I''m overall very happy with my experience so far. My only real annoyance so far has been forgetting to call "do_post" or "do_create" from my specify blocks. My mocks don''t get the calls they want, and it usually
2007 Nov 07
10
Plain Text Story example
Hey all, Does anyone have an example(s) of the plain text story runner for rails? I have read David''s blog (http://blog.davidchelimsky.net/articles/2007/10/22/plain-text-stories-on-rails) about it but I would like to see some examples with all of the step matchers included... I couldn''t find any more examples on google talking about the plain text stories and the example
2007 Jul 29
24
View-Driven-Development by Behavior-Driven-Development and RSpec
One of the things that turned me on to BDD and RSpec was speccing views first, that the desired end would drive the development. In previous projects while using Test::Unit I would try to make educated guesses as to what would be needed in the model and controllers to derive the view without actually writing the view until afterwards. This is all because testing relied on each previous
2007 Sep 04
3
Model Specs: Fixtures vs Mocks + Stubs?
What is the general opinion about fixtures versus mocking and stubbing in model specs? I heard from agile on IRC that they save the database testing for integration testing, but I also see that the caboose sample applicaiton uses fixtures. I also noticed that on the rspec site, it says "Ironically (for the traditional TDD''er) these are the only specs that we feel should actually
2007 Sep 18
2
rSpec / Nested Routes / Mocks
I''m having a terrible time trying to test a nested route with rSpec. I can''t seem to tell rSpec to expect the call @item.user. The following error message plagues me not matter how I try to fuss with the mock: Spec::Mocks::MockExpectationError in ''ItemsController handling POST / items should redirect to the new course on successful save'' Mock
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
2007 Dec 20
19
Story runner rake task
What''s the status on a rake task for the story runner. If nothing is in progress, where could I start to try and build one? JD
2007 May 30
6
authentication mocks
hi I''m using restful_authentication and have controller specs working using users fixtures (and login_as) however i''ve been trying for hours without success to do it without fixtures, using mocks and stubs instead. anyone here done this? got code? :) thanks
2009 Apr 22
15
Why RSpec?
I like Shoulda. Sometimes I like plain old Test::Unit. Cucumber gives me a different thought process. I''d just like to hear some thoughts on why RSpec? What does it buy me that I can''t get with Shoulda? I just can''t seem to think in RSpec. Where is there a good example of RSpec tests that will help me grasp the right path? Thanks! -- Amos King
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 Jan 12
5
Integration Testing - Wait, Watir, or Selenium
I''m evaluating what to use for integration testing: SafariWatir - integrates nicely with RSpec - doesn''t work with Ajax because of Safari event firing issues Selenium - Works with Ajax - doesn''t integrate with RSpec What is the best guess timeframe for RSpec integration testing? Will it be able to test Ajax application in the early iterations? Thanks, Brian Yamabe
2009 Mar 04
5
Sinitra 0.9.1 Webrat 0.4.2 Cuc problem
Have created sample sinatra cucumber app as suggested on wiki. Tried both env.rb configurations from there and aslaks git repo. With this combination of gems I get the following error doing basic cuc tests When I visit ''/foo'' # features/step_definitions/general.rb:1 PATH_INFO must start with / (Rack::Lint::LintError)
2008 May 08
7
Rspec Stories / Selenium Nightmare
I have been using Rspec stories with Webrat feeling very productive and happy. Then I needed to do something with Selenium (Webrat could have done what I needed but it does not yet have the functionality). Selenium-core as part of a rails plugin looked nice but did not seem to fit with rspec stories. So I went the Selenium-rc route. Since Selenium uses a separate instance of rails