search for: person_spec

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

2007 Apr 10
5
using YAML for --failures and --examples
...currently, in trunk, --failures and --examples except a text file, each line containing the name of a spec. I''m wondering: Would a a patch to use YAML (instead or as well as) plain text be welcomed? I''m thinking of a yaml file like the following: spec_file_1: file: spec/person_spec.rb specs: - should have first name - should provide email address spec_file_2: file: spec/client_spec.rb specs: - should have meeting on monday - should drink on friday Any thoughts? Scott
2007 May 27
3
[NoMethodError] simple problem
I think this test should pass but it doesn''t 1) NoMethodError in ''Person should return full name'' undefined method `full_name?'' for #<Person:0x3567964> ./spec/models/person_spec.rb:43: describe Person do it "should return full name" do person = Person.new person.should be_full_name end end class Person < ActiveRecord::Base def full_name true end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ruby...
2007 May 27
12
Checking for Range
how would you check for a range using rspec? person.password.range.should == Range.new(5..40) <- this doesn''t work -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070527/4d8cb007/attachment-0001.html
2007 Jun 08
2
Testing two interdependent ActiveRecord models
...at needs testing.) Here are my observations / questions: 1. Since there are two models, it doesn''t seem quite right to make a unit test for this, does it? 2. There is an interaction between the two models. What is a good way to test the interaction? Do I put some of the testing in person_spec.rb and some in contribution_spec.rb? Or do I create some sort of "interaction" spec? 3. I don''t think that an integration test makes sense, because I don''t want to test the controller and views. 4. I wonder if mocks or stubs would make sense. I don''t think...
2006 Dec 27
2
DB-less rspec_on_rails
...I removed all the db:* dependencies from the RSpec targets, but it still wants to connect to a database. Any ideas? bye, Tobias ** Execute spec:models /usr/bin/ruby1.8 -I"/var/lib/gems/1.8/gems/rspec-0.7.5/lib" "/var/lib/gems/1.8/gems/rspec-0.7.5/bin/spec" "spec/models/person_spec.rb" F 1) Mysql::Error in ''This sample spec should work without a database'' #28000Access denied for user ''root''@''localhost'' (using password: NO) Finished in 0.026762 seconds 1 specification, 1 failure rake aborted! Command failed with s...
2007 Jun 25
0
Problem with RSpec in legacy databases
...roblems. But this doesn´t seem to work in RSpec. Anybody knows how to use it? This is a sample of the code The model --------- class Person set_table_name = tbl_people ... end the fixture file (tbl_people.yml) ---------------------------------- one: id: 1 name: John and the spec file (person_spec.rb) ---------------------------------- describe Person, "in general" do set_fixture_class :tbl_people => Person fixtures :tbl_people before(:each) do @a_person = tbl_people(:one) end it "" do @a_person.should be_valid end end Fixture data is loaded in...
2006 Oct 17
3
Should fixtures be transactional?
I started using the new Model.should_have(1).records expectation in rspec_on_rails, and quickly realized that my fixtures were remaining loaded, even in contexts that didn''t use them. Bug or feature? Jay Levitt
2007 Jul 26
5
Coding standards and whitespace
...s example_rails_app/public/javascripts/effects.js example_rails_app/spec/controllers/naughty_controller_spec.rb example_rails_app/spec/controllers/people_controller_spec.rb example_rails_app/spec/fixtures/animals.yml example_rails_app/spec/helpers/people_helper_spec.rb example_rails_app/spec/models/person_spec.rb example_rails_app/spec/views/person/create_view_spec.rb example_rails_app/spec/views/person/show_view_spec.rb example_rails_app/spec/watir/person_spec.rb example_rails_app/TODO pre_commit/lib/pre_commit/core.rb pre_commit/lib/pre_commit/pre_commit.rb pre_commit/lib/pre_commit/rspec.rb pre_commit...