similar to: Trying to come up with a nice DSL, but having some problems

Displaying 20 results from an estimated 5000 matches similar to: "Trying to come up with a nice DSL, but having some problems"

2006 Apr 10
6
Object isn''t being saved when called through association
I have three models in this small game I''m working on - the Game, Players, and Turns. A Player should be able to rescue another Player on any given turn. So it looks like this: class Game has_many :players has_many :turns def rescue_player(p) t = turns.last t.rescued = p t.save end end class Turn belongs_to :rescued, :foreign_key =>
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
Signed-off-by: Scott Seago <sseago at redhat.com> --- src/test/functional/host_controller_test.rb | 41 -------------------- .../functional/managed_node_configuration_test.rb | 14 ++++--- src/test/functional/nic_controller_test.rb | 8 ---- src/test/functional/permission_controller_test.rb | 15 ++++--- src/test/functional/quota_controller_test.rb | 2 +-
2006 May 15
0
acts_as_list, move_higher, odd indexing behaviour?
Hi, [reposting to list, posting via google groups apparently didn''t work] I''m trying to use acts_as_list for the first time. Can anyone confirm the odd behaviour reported here? http://blog.nominet.org.uk/tech/Web/2006/03/06/Using_acts_as_list_in_... i.e. element access and move_higher require an odd indexing scheme to work. I''m personally finding that I
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__) +
2006 Apr 13
0
Globalize not with Rails 1.1.2
Does anybody have the latest Globalize (r184) working with Rails 1.1.2? I can''t seem to get a very simple example to work: ----- ruby test/unit/news_item_test.rb Loaded suite test/unit/news_item_test Started F. Finished in 0.10109 seconds. 1) Failure: test_add_content_translations(NewsItemTest) [test/unit/news_item_test.rb:49]: <"US Title"> expected but was
2006 Mar 20
2
Testing Models And Fixtures
I have finally decided to look into testing and I am going through the examples in the AWDWR book and I tried the following and it does not work... even though I don''t see why it shouldn''t. =========== posts.yml =========== basic_post: id: 1 title: Title body: Body created_at: 2006-02-01 00:00:00 updated_at: 2006_02-02 00:00:00
2009 Jun 29
0
[PATCH server] Add svc_vm_actions method to VmService.
Also includes a couple minor model changes to support better error reporting. This method was added so that a client could submit multiple vms to the service layer in one call and get back appropriate messages showing any failures without those failures also causing the entire call to fail, or forcing the client to implement handling (begin/rescue blocks) of these errors to continue through the
2006 Jun 25
1
Unit Testing failure
When I run the unit testing code in Unit Testing Models chapter of the Agile Rails book, I get the following error: $ ruby test/unit/cart_test.rb Loaded suite test/unit/cart_test Started F. Finished in 0.21806 seconds. 1) Failure: test_add_duplicate_product(CartTest) [test/unit/cart_test.rb:22]: <4690> expected but was <3579>. 2 tests, 3 assertions, 1 failures, 0 errors require
2006 Jun 07
6
I want to stick my models in a module
I''ve got enough models now that I''d like to separate them into modules. For example, I have the class Player that I want to stick in the Trainer module. I''ve changed the definition to class Trainer::Player I''ve created a models/trainer dir, test/unit/trainer, and test/fixtures/trainer. Change the PlayerTest class to be Trainer::PlayerTest. I get the
2005 Oct 30
1
attaching the debugger to functional test.
People, I''m trying to run the ruby debugger against a Test::Unit::TestCase class which is a parent of a Rails class. I started my study with a simple script: # # bikle_test.rb # require ''test/unit'' class BikleTest < Test::Unit::TestCase def setup @string10 = "hello" end def test10 assert_equal @string10, "hello" end end The
2007 Mar 13
0
ActiveRecord: strange tree behavior???
hi, can someone help me with understanding, why i can''t get my set_sub_tree method to run correctly and what to do to make it work? when i run the testcase below i get --- D:\ruby\test>ruby test/unit/demo_test.rb Loaded suite test/unit/demo_test Started F Finished in 0.625 seconds. 1) Failure: test_set_sub_tree(DemoTest) [test/unit/demo_test.rb:13]: fails@4. <200> expected
2006 May 19
3
new to rails; problem with testing section in Agile book
Hello, I should give the expected disclaimer that I am brand new to rails and am going through the Agile web development with Rails book right now. I am in the testing section and I can''t get past an error. this is my cart_test.rb test file: require File.dirname(__FILE__) + ''/../test_helper'' class CartTest < Test::Unit::TestCase fixtures :products def setup
2016 Jun 07
0
[PATCH 2/2] ruby: tests: Give each test class and method a unique name.
'tc_410_close_event.rb' was not being run. You could prove this by simply inserting "exit 1" into that test. The reason is unclear, but by renaming every class and method in the tests to be unique, this ensures the tests are run. --- ruby/t/tc_010_load.rb | 4 ++-- ruby/t/tc_020_create.rb | 4 ++-- ruby/t/tc_030_create_flags.rb | 4 ++--
2006 Apr 21
2
destory Test Case Messes up all tests
I am trying to create unit tests for my users model but when I add a test that destroys a user, that user is not available in any of the other test. If I remove the test that destroys the user all my other tests work again. All the fixtures are suppose be reloaded between tests right? Here is my testcase : require File.dirname(__FILE__) + ''/../test_helper'' class UserTest
2006 May 05
7
Testing model: test becomes dependent on previous test
Im having trouble with Testing models. im following the tutorials in the book Agile Web Development with Rails. if i execute the code product_test.rb, i get this error: ============================================================ 1) Failure: test_update2(ProductTest) [test/unit/product_test.rb:30]: <29.95> expected but was <99.95>. 3 tests, 11 assertions, 1 failures, 0 errors
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
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
2006 Mar 07
3
STI and unit testing
Hi all, I''m having a bit of a problem with unit testing. I''ve simplified my models to try and get my head round it but I''m still struggling. I''m using STI and trying to write tests for the extended models (code below). I''ve written test cases for the extended models which themselves extend the test case for the parent model, so BarTest extends
2006 May 04
2
Testing associations
I have a pretty simple model, articles and users. class Article belongs_to :user end class User has_many :articles end In my unit tests I want to ensure that the associations work properly. What''s the best way to do this? The obvious thing to do is a test in each model. # user_test.rb def test_add_post u = users(:first) before_articles = u.articles.count u.articles
2007 Jul 11
0
Its nice to know that at my age i can still count on having a nice load. You guys are amazing with your delivery and customer service.
've used wondercum for a number of motnhs now, and it seems to have improved the amount of ejaculation. Doctor-approved formula. http://nishtest.com