search for: assert_equals

Displaying 20 results from an estimated 312 matches for "assert_equals".

Did you mean: assert_equal
2007 May 30
4
aaf and dynamic attrs: a bug?
Hi! I faced some issue while using it for dynamic attrs indexing/search. Maybe I made something wrong. Here is test method. Everything works just fine until last line http://pastie.caboo.se/66274 . Tested on both stable and trunk of aaf and ferret 0.11.4. the short version of code below: Contact.acts_as_ferret :fields => [ :first_name ] assert
2009 Sep 01
13
Function Testing Reloading Fixtures before assertion
Hey Everyone, I have a function test the is failing (despite the fact the function actually works in the application). I was looking for some debug advice on how to find my problem. Here is the test: def test_should_delete_word assert_equal ''published'', words(:one).status debugger delete :destroy, :id => words(:one).to_param assert_equal
2007 Oct 21
0
Taking a stab at a pure Ruby Dir.glob
Hi all, Here''s what I''ve come up with so far for a pure Ruby Dir.glob for MS Windows. It almost works. The problem right now is the [] notation, which I''m not translating properly into a regex. I haven''t started on the ''**'' notation yet either, but I figure that''s more of a control flow issue. Feel free to disagree with me and/or
2019 Jan 17
1
[hivex PATCH] ruby: improve test functions
Use better functions to check for proper values instead of assert: - refute_nil for non-null functions - assert_equal for checking equality Also, make sure that the parameters for assert_equal are correct: expected value, then got value. --- ruby/tests/tc_120_rlenvalue.rb | 4 ++-- ruby/tests/tc_130_special.rb | 12 ++++++------ ruby/tests/tc_200_write.rb | 4 ++--
2005 Dec 31
2
Test Unit Problem
Hello All, I am experiencing the following test unit error working with Rails that I can''t fathom. I have a products.yml file which holds the following test fixture for the products table: dell_pc: id: 1 title: Dell PC description: Dell PC image_url: http://.../pc_image.jpg price: 15000.00 date_available: 2005-12-31 06:53:00 I also have the following product_test.rb file to
2017 Jun 15
0
[PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
Create a module ‘C_utils’ containing functions like ‘drive_name’ and ‘shell_unquote’ which come from the C utilities. The new directory ‘common/mlutils’ also contains the ‘Unix_utils’ wrappers around POSIX functions missing from the OCaml stdlib. --- .gitignore | 3 + Makefile.am | 24 ++--- builder/Makefile.am
2006 Apr 16
5
Newbie Problems with pluralization
Hi, I have a many to many relationship incorporating the following tables: taxes --> taxes_tax_groups --> tax_groups I have a model named tax with the following declaration: has_and_belongs_to_many :tax_groups and I have a model named tax_group with the following declaration: has_and_belongs_to_many :taxes I am attempting to run the following unit test: require
2006 Sep 29
1
yielding consecutive values
I''m not sure if someone has already addressed this issue, but if not, here goes. I need the following behavior: def test_generate(documentation = ''/test_documentation/'', destination = ''/destination/'') yield_results = [''/'', ''filename.yaml'', ''blah.xml'']
2005 Mar 09
9
Unit testing + instance variables
After *much* digging and playing around, I finally figured out how to unit test instance variables that are created by actions. It was more difficult than I expected. It seems like there should have been a more straight forward way to do this. Can someone enlighten me? A simplified and somewhat contrived example of what I am current doing: Thanks. Matt >> # My Controller of interest
2007 Jul 06
3
assert_equal - problems returning value from controller
Hi, I have the following assert_equal that is returning false. @q seems to be returning niil, but is set in the controller, how can I get hold of this value in my tests? assert_equal ''derby'', @q Thanks Mark -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2006 Apr 21
2
NoMethodError with test_read_with_hash
While running the product_test.rb test fixture in the Agile Web Development book (p. 148), but when I run ruby test/unit/product_test.rb, I get the following error: 1) Error: test_read_with_hash(ProductTest): NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[]
2010 Aug 06
1
New bie question: Why use assert_equal when there are comparison operators in Rspec?
...me related material to put BDD in my new rails app. I have also checked out Ryan Bates'' railscasts on rspec (that''s how I got to know about Mocha). Reading up on the Rspec''s main site, the main example in http://rspec.rubyforge.org/rspec/1.3.0/ does not show any use of assert_equals. Rather it just uses the "==" comparison operators. Here''s an extract: ============ Extract begin =========================== it "reduces its balance by the transfer amount" do source = Account.new(50, :USD) target = stub(''target account'...
2006 Jul 06
0
problema con i test automatizzati
ciao a tutti.     come al solito, sto andando avanti a piccoli passi nel creare l''applicazione depot del libro "Sviluppare Applicazioni Web con Rails". Ora mi trovo nella fase di creazione dei test automatizzati. Ma c''è una cosa che proprio non capisco: Ho la seguente classe in ~/depot/test/unit/product_test.rb require File.dirname(__FILE__) +
2010 Nov 14
2
Question re assert_equal
In Agile Web Development with Rails, the following statement is given: assert_equal "has already been taken", product.errors[:title].join(''; '') My question is: Why is the join(...) needed and what exactly does it do here? If it does what I assume, join an array of strings and use "; " as the separator, then I wonder how the assert_equal statement could ever
2006 Jan 16
2
My first test - named fixture not autoloading instance variable
I''m trying to write a test like the one at the bottom of page 148 in Agile Rails. I''m using rails 1.0 I''ve created the fixture correctly I''m pretty sure because the test database table is being populated per the fixture. I have what I think is a simple unit test: ========= require File.dirname(__FILE__) + ''/../test_helper'' class CaseTest
2019 Jan 16
1
Re: [PATCH 3/5] mltools: add simple tests for external_command
On Wed, Jan 16, 2019 at 03:17:33PM +0100, Pino Toscano wrote: > --- > common/mltools/tools_utils_tests.ml | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/common/mltools/tools_utils_tests.ml b/common/mltools/tools_utils_tests.ml > index 1489fe699..f3c39514d 100644 > --- a/common/mltools/tools_utils_tests.ml > +++
2006 Jan 22
23
calculate users age
i know it''s probably really simple, how do i work out someone''s age if i have their d.o.b. stored as a date in my db. cheers -- Posted via http://www.ruby-forum.com/.
2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
On my current project I needed to create a stub that responded correctly to the id message. Here''s the change I put into my copy of head. Index: lib/mocha/mock_methods.rb =================================================================== --- lib/mocha/mock_methods.rb (revision 1114) +++ lib/mocha/mock_methods.rb (working copy) @@ -68,6 +68,7 @@ method_names =
2009 Jul 01
1
[PATCH server] fixed expected status messages that were failing unit/functional tests.
--- .../functional/cloud/instance_controller_test.rb | 2 +- src/test/unit/vm_service_test.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb index 71d132b..0d713d4 100644 --- a/src/test/functional/cloud/instance_controller_test.rb +++
2006 Mar 04
2
unittest, not loading yml data
Here is my products.yml version_control_book: id: 1 title: Pragmatic Version Control description: How to use version control image_url: /images/sk_svn_small.jpg price: 29.95 date_available: 2005-01-26 00:00:00 automation_book: id: 2 title: Pragmatic Project Automation description: How to automate your project