search for: martinfowl

Displaying 20 results from an estimated 27 matches for "martinfowl".

Did you mean: martinboel
2006 Jun 05
2
Class Table Inheritance implementation
I know that Rails uses the Single-Table Inheritance as mentioned in the wiki (http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance). I was wondering if there was an easy way of implementing Class Table Inheritance easily (one table per class) as defined in http://www.martinfowler.com/eaaCatalog/classTableInheritance.html. The model that I am used to is Class Table Inheritance, and for some uses it just feels more elegant to use that rather than Singe Table Inheritance. -- Posted via http://www.ruby-forum.com/.
2006 Jan 18
3
Support for foreign keys in Migrations
...uot;Application Database" style over the "Integration Database" style [1] as defined by Fowler? I''d love to see support for foreign keys in Migrations. For selfish reasons I''d be most interested in such support for SQL Server and Oracle. Cheers, Steve [1] http://martinfowler.com/bliki/DatabaseStyles.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060118/6a1305bb/attachment.html
2007 Feb 05
10
how does Mocha compare in terms of classical vs mock-based testing, and stubbing???
Hi guys, I''ve just been reading Martin Fowler''s article re mock versus stubbing<http://martinfowler.com/articles/mocksArentStubs.html>where he compares traditional TDD testing techniques with mock based testing. I''d be interested in comments from a ruby on rails perspective in terms of this and Mocha? For example: a) Do you see Mocha as a robust way to test Ruby on Rails based app...
2006 Feb 20
5
find(:all) vs find_all
I started with Ruby on Rails in the 0.13.x period, so I''m sure I missed out on a lot of history. There''s probably some good explanation for something I''ve been wondering about, but I haven''t seen it written down anywhere. Maybe someone can clue me in. I''ve always felt that one of the uglier APIs was the ActiveRecord::find() method. I call
2005 Jan 13
10
Program logic behind Ruby On Rails
Hi, I''m a newbie in both Ruby and Ruby on Rails. I finished the Ruby on Rail Tutorial on Todo list and it was great. But, now I''m trying to understand the logic behind it, that is something that is not obvious on how each one of them ties together. Is there a flowchart that shows how the inner working of Ruby on Rails? In another words, let''s suppose we consider the
2008 May 18
2
Using Hash to mock classes that respond to :
Hi I''ve been doing this a while now. If I have a class that responds to : [], and all I''m interested in stubbing is that method, then instead of using a mock I just create a hash. (Similarly, you could create an array when you are testing an Enumerable object.) Example from code I just worked on, where uses MigrationGraph#[] looks up graph vertices by name:
2006 Jan 10
14
Not wishing to instigate a DB war, but...
Can I get some opinions on which free DB to use with rails for a virtual server that will eventually be doing lots of heavy database lifting? Not a lot of heavy duty querying per se. Think multiple simultaneous forums and blog sites and the like. I know each of the different DB possibilities such as MySQL and PostgreSQL has plus points and minus points. I''m particularly interested
2006 Mar 14
4
Two Customer Types - Best Design Principle?
Hi all, I''ll do my best to explain this... I have the possibility to have two customer types in my system: 1. A "mailing list" type: new records are saved when user enters email address in the mailing list subscription form. 2. A "full" type: new records are saved when the user buys something and provides all their billing/shipping details, etc. Model: -
2006 Jan 02
11
aligning Ferret''s IndexSearcher.search API with Lucene''s
Recently I''ve been revisiting some of my search code. With a greater understanding of how Java Lucene implements its search methods, I realized that one level of abstraction is not present in the Ferret classes/methods. Here are the relevant method signatures: Ferret''s search methods: in Ferret::Index::Index: search(query, options = {}) -> returns a TopDocs
2005 Jun 27
9
FK constraints overrated?
Hello folks, I use to think that a relational databases without foreign keys constraints enforced strictly by the RDBMS were no good, piece of crap, data junk. However, I''ve also learned the hard way that FKs constraints imposes serious difficulties when moving data around, specially between different DBs, or for loading test data or for upgrading DBs schemas, or for porting DBs
2008 Jan 11
2
guide to good mocking?
Hi all - does anyone know of a good blog post or wiki or something with a good guide to mocking? I''ve got some degree of responsibility for people who are creating mocks. I''m supposed to actually be telling them the best way to do it. In some cases we have code with like a bazillion mock(:x) statements and it''s kind of out of control. I have an idea how the specs should
2007 Jan 11
4
counter-intuitive behaveour when passing a proc to Mocha::Expectation#returns
Let''s say that I have a procedure that: * gets the number of bytes to write into some file * and returns the number of successfully written bytes def save( text, len ) This procedure is being used all over the place especially inside the method "process" which I want to test. Thus in order not to polute my filesystem I stub the "save" procedure. But of course in
2007 Aug 29
5
Undefined method stub
When I try to execute the following example, I get an error message: /usr/local/lib/ruby/gems/1.8/gems/mocha-0.5.4/lib/mocha/object.rb:40: in `expects'': undefined method `stub'' for nil:NilClass (NoMethodError) from test8.rb:5 What could be the reason? I tried with the latest Mocha Ruby gem, and I also tried it with the Rails plugin. The example: require
2006 Feb 02
6
How do I? Same Model, Different Controllers, Different Validations?
Hi all -- The simple question is: How do I set different validations for the same Model, when accessed in different Controllers? Here''s the scenario: I have a store/cart app, with a customer-facing shopping cart, and a typical Admin side. The Admin side also has an Order Entry component, where our staff can enter orders received by fax, telephone, etc. Both the customer-facing cart
2007 Feb 06
3
Using any_instance with Rails to make sure the right thing is saved?
I''d like to test that an object with the correct attributes is saved, something like: def test_create_without_existing_suite this = self w = Annotation.any_instance.expects(:save).with do |x| this.assert_equal ''fnord'', some_way_get_the_name_of_the_receiver_of_save true end w.returns true end But the object is created inside the method
2007 Mar 27
3
Stubbing out method for all instances
I am using the acts_as_state_machine plugin to control state of an object in my app, however when testing this I need to be able to stub out the guard conditions so that state will change when I fire off an event without depending on other models. Guard conditions simply return true or false so I have an instance method: def encoded? <check state of other objects> return true
2008 Jan 01
26
Did DHH have a suit on?
So I''m wondering about the origin of "ActiveRecord" and "ActionPack" and the like in Rails. I''ve always thought that perhaps DHH found himself in a suit one day (maybe he had to attend a friend''s wedding or something), and as long as he had the suit on, decided to lapse into a one of the barely lucid frenzies that Marketing people are prone to when
2017 Jan 04
5
RFC: Reconsidering adding gmock to LLVM's unittest utilities
...long email, but I wanted to try and lay out the issues in a way folks could understand, and the examples, while hopefully useful, are quite large and complex. Please don't hesitate to ask questions if stuff isn't clear. -Chandler [1]: https://en.wikipedia.org/wiki/Test_double [2]: http://martinfowler.com/articles/mocksArentStubs.html -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170104/b1da1d7c/attachment.html>
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,
2009 Jun 29
3
Table Inheritance based on a function
Hello, we have a problem in a CMS project that we believe is basic for RoR developement and could concern others as well - or have already: RoR implements the ''Single Table Inheritance'' (STI) Pattern: http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html .. through its ''ActiveRecord'' ORM. The Fowler example mentions a ''type'' column and RoR implements this directly - which we consider inconsistent with DB abastraction: It forces a ''type'' column in the...