similar to: RSpec 2 matchers 'code-spec' and 'file-spec' released

Displaying 20 results from an estimated 30000 matches similar to: "RSpec 2 matchers 'code-spec' and 'file-spec' released"

2010 Jun 10
1
RSpec 2 equivalent for: assigns[:message].should == @message
describe MessagesController, "POST create" do before(:each) do @message = mock_model(Message, :save => nil) Message.stub(:new).and_return(@message) end context "when the message fails to save" do before(:each) do @message.stub(:save).and_return(false) end it "assigns @message" do post :create assigns[:message].should
2010 Sep 08
4
Re-using Rspec Matchers
Hey Everyone, Is it good practice to call matchers from within matchers? Kinda like this pattern: See: http://gist.github.com/570467 -- Brian
2011 Jul 28
2
RSpec, shoulda-matchers and Rails model attributes validations
I was trying out RSpec framework in a project and got stopped doing the unit test of a model. In particular, doing the test for the associations and the ActiveRecord validations. I started writing the validations but my tests didn''t look DRY at all. Before refactoring the tests checked out and look for other people solutions. I found out shoulda-matchers and Shoulda (which if I
2011 Jan 02
3
undefined method `run_all' for :Array
I''m using the latest ruby 1.9.3-head and recently whenever I run rspec (2.2+) I get the following error: I have seen others have run into this issue, but to resolve it just rolled back to a previous version of rspec or it there a better way? ruby-1.9.3-head/gems/rspec-core-2.3.1/lib/rspec/core/hooks.rb:116:in `run_hook_filtered'': undefined method `run_all'' for []:Array
2011 Oct 08
1
Rails view spec expectations/matchers
>From looking at the RSpec Rails documentation (https://www.relishapp.com/rspec/rspec-rails/docs/view-specs/view-spec) it seems like rendered is just a string and you can''t really do any assert_select type stuff out of the box. After Googling around, it seems that the RSpec authors decided that if you want that functionality, you should just use Capybara or some such... is that
2008 Aug 22
2
How to find/open Spec::Expectations and Spec::Matchers
Hi, Then RSpec 1.4 recommends, in the webpage http://rspec.info/documentation/expectations.html, referencing the subject items. I''m running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] over WinXP-Pro/SP2. I believe I installed RSpec with a Ruby gem. At least, I think that''s confirmed because I have a lot of stuff in the directory K:\_Utilities
2010 Jun 28
1
have_tag matcher in rspec 2?
I always assumed have_tag was part of rspec, but it''s not in rspec 2, and looking now I don''t see it in rspec 1 either. Webrat defines it, but that seems like a coincidence (I tried requiring webrat/core/matchers to no avail). Is it depricated, not yet implemented, or does it work for everyone else? My project is from scratch, rspec-rails 2b13, using generated spec_helper.
2008 Mar 04
2
Matchers tutorial ...
I am looking for a good a - z matchers tutorial . Anyone got a url for one? Thanks Anthony Broad-Crawford -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080303/fd652444/attachment-0001.html
2009 Mar 15
0
rspec 1.2.0 Released
rspec version 1.2.0 has been released! Behaviour Driven Development for Ruby. Changes: ### Version 1.2.0 WARNINGS: * If you use the ruby command to run specs instead of the spec command, you''ll need to require ''spec/autorun'' or they won''t run. This won''t affect you if you use the spec command or the Spec::Rake::SpecTask that ships with
2007 Aug 02
2
Do the :attributes and :content matchers work
[Rails plugin 1.0.5] Hi, I am looking for some guidance. When working on a partial which looks like this <div class="bug" style="width: 100%;" /> I have some examples which should fail - I think - but do not: it '' should fail'' do response.should have_tag( ''div.bug'', :content => ''There is no
2009 Mar 15
0
rspec-rails 1.2.0 Released
rspec-rails version 1.2.0 has been released! * <http://rspec.info/> * <http://wiki.github.com/dchelimsky/rspec> * <http://wiki.github.com/dchelimsky/rspec/rails> * <http://wiki.github.com/dchelimsky/rspec/upgrades> Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.0 IMPORTANT INFORMATION: Due to changes in Rails-2.3, there are some changes in
2007 May 03
0
predicate matchers
Hey all, If any of you are using the new predicate_matchers feature, I just committed a change to it in trunk. See http://rubyforge.org/tracker/index.php?func=detail&aid=10542&group_id=797&atid=3152 for more details, but the high level is that instead of this: predicate_matchers[:method_on_object] = :method_in_spec It now (as of rev 1898 - soon to be released in 0.9.2) does this:
2009 Oct 06
3
rspec-rails 1.2.9 Released
rspec-rails version 1.2.9 has been released! * <http://rspec.info> * <http://rubyforge.org/projects/rspec> * <http://github.com/dchelimsky/rspec-rails> * <http://wiki.github.com/dchelimsky/rspec/rails> * <rspec-devel at rubyforge.org> Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.9 / 2009-10-05 * enhancements * added route_to and
2011 Nov 06
0
rspec-2.8.0.rc1 is released
http://blog.davidchelimsky.net/2011/11/06/rspec-280rc1-is-released/ See the blog post for more information, but highlights include: 1. tag overrides Now you can set tag/filter defaults in .rspec: --tag ~javascript or in RSpec.configure (in spec_helper.rb): RSpec.configure {|c| c.filter_run_excluding :javascript} and then override that from the command line when you want to run the
2011 Sep 14
1
rspec and should have_many through
Hi, Anyone can help me with rspec shoulda validations please. I can''t get the syntax right for these validations. Please correct me it { should have_one :tradable, :through => :trade_order} it { should belong_to :source, :polymorphic => true } it { should have_many :transfers, :as => :source } this is for Rspec 2, rails 3.1, gem "rspec-rails" gem
2008 Apr 29
5
Sharing: dont_repeat_yourself plugin custom RSpec matcher
I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans. I wrote it using RSpec and I have included a RSpec custom matcher: it { rails_application. with_threshold_of_duplicate_lines(4). should be_DRY } If you use Autotest, your specs will fail the next time you do a nasty copy-paste !!! More details in
2007 May 10
1
RSpec 0.9.4
RSpec 0.9.4 has just been released. Gems haven''t rsync''ed around the globe yet, so you might have to wait a few hours to install it. The big news this time is Spec::Ui 0.2.0, which has been released along with RSpec core. This RSpec extension gives you custom Watir matchers (custom Selenium-RC matchers are not implemented yet). Moreover, it comes with a custom KICK ASS formatter
2011 Sep 22
3
uninitialized constant Spec::Rails (NameError) when running spec command
I get the following error when trying to run a spec command on a model test. The command is :- C:\Rspec Test\spec\models>spec bank_account_spec.rb The error is :- c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rspec-rails-1.3.0/lib/spec/rails/ matchers/ ar_be_valid.rb:2: uninitialized constant Spec::Rails (NameError) from c:/jruby-1.5.0/lib/ruby/gems/1.8/gems/rspec- rails-1.3.0/lib/spec/ra
2010 May 12
8
Trouble developing Rails plugins/gems with generators
Hi, I''ve been trying to develop a Rails gem/plugin with generators for Rails 3. I first had a separate gem project with a gem statement in my Gemfile with a :path option to point at it. But then I had to run $ rake install on each change in my gem to have Rails pick up on it. I have now instead put my generators inside RAILS_ROOT/lib so they are easier to test/develop. lib/generators -
2007 Jun 05
0
Fwd: testing - test/spec and rspec
are you guys aware of this?? :) Begin forwarded message: > From: topfunky <topfunkycorporation at gmail.com> > Date: June 4, 2007 8:35:24 PM EDT > To: PeepCode <peepcode at googlegroups.com> > Subject: Re: testing - test/spec and rspec > Reply-To: peepcode at googlegroups.com > > > On 5/28/07, Neil <neilrahilly at gmail.com> wrote: >> Just