Displaying 20 results from an estimated 500 matches similar to: "DRYing up controller tests and mailer tests using superclasses"
2007 Feb 07
8
Apache+Mongrel Redirection Problems
Hi folks,
Newbie issues...I''m prototying an Apache/Mongrel configuration setup
as follows:
* Two Mongrel servers each serving a Rails application.
* Apache front-end.
* Linux system (CentOS)
* The plan is to create two virtual hosts.
/ETC/HOSTS LOOKS LIKE THIS:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1
2006 Nov 28
0
"Exec format error" (Windows)
Hey again :)
I have this weird issue on Windows. I''ve installed mongrel_cluster and
friends, and I''m trying to get a cluster up and running. Here''s my
mongrel_cluster.yml:
------------
---
port: 8000
environment: production
address: 127.0.0.1
pid_file: log/mongrel.pid
servers: 10
cwd: c:/railstest
docroot: public
log_file: log/mongrel.log
------------
I''ve
2010 Sep 16
1
[LLVMdev] Linking shared library
Hi,
I have conventional directory structure for a pass taken from project examples.
I want to build a tool which makes usage of a shared library which is included in the project.
This means that I have library here:
# lib/foo/*.cc
and after compilation the library is placed here
# Debug/lib/libfoo.so
My tool is located here:
# tool/test_foo
# cat tool/Makefile
LEVEL = ../
TOOLNAME=test_foo
2007 Feb 22
1
OT(?): ReverseProxy and URLs
This could be OT. If so, just let me know and I apologize in advance.
I mentioned in an earlier email that I have Mongrel setup as a proxy server
behind Apache. Rails applications served by Mongrel do not find the CSS file
and hence no styles are displayed. In fact, many of the actions are not
found.The reason, I believe, is because the URLs for styles and actions
typically follow this pattern:
2005 Sep 10
2
Output of warnings inside the source function
Hello, all.
There is a problem to get an output of warnings() function to sink in a
file specified.
There are to files
1. File "test" with content:
source("test_foo",local=T)
2. and file "test_foo" with content:
options(warn = 1)
sink("c:/temp/foo.txt",append=F)
warning("Foo warning")
warnings()
sink()
3. If I run R as
"c:\Program
2006 Feb 04
1
RUnit - need advice on a good directory structure or tips...
I made my own RUnit testing convention, and I want to introduce this to one
of my friends.
Before that, I'd like to review my codes.
The problem that I met when I tried to polish my codes is: How can I get the
file path in the file???
I.e., I want to get the path to the file that I'm writing using some magic R
functions. But I couldn't find any good magic.
Is there any magic?
So, I
2005 Dec 14
0
relative subdirectory of partials
if im in the views dir for the railtstest controller and
render a partial like so: render(:partial=>''container/
thepartial'') then
it will only work if that partial is in views/container/thepartial
not if its in
views/railstest/container/thepartial as I expected.
but what i want is to have a dir called container inside of railstest
and be
able to render a partial
2007 Nov 26
0
rSpec (rev 2996), Rails (rev 8214): TextMate bundle problems
Hey guys,
I''m trying to get rSpec (rev 2996) working with Rails 2 (rev 8214).
Running the tests from the command line works, no problem.
I installed the RSpec.tmbundle (also rev 2996), and would like to see
the HTML test results in TextMate. When I run the "Run examples in
selected files/directories" command in TextMate, I get the following
dump:
2005 Jul 22
3
testing application_helper.rb
I am trying to run some functional (or are they unit?) tests on my
application_helper.rb. So far, I''ve not had any success in being able
to call the methods defined in application_helper.rb.
Here is my app/test/functional/helpers.rb
require File.dirname(__FILE__) + ''/../test_helper''
require File.dirname(__FILE__) +
2006 Aug 04
1
All Fixtures plugin
Just released a very simple plugin for including all fixtures in your
tests. Once you have a large number of table, manually managing the
fixtures for every single test stub can be quite tedious.
Use as follows
class BlogArticleTest < Test::Unit::TestCase
all_fixtures
def test_foo
...
end
end
Couldn''t be easier. More info here:
2006 Oct 28
2
where is the "record" method??? i.e. which is used in generators (e.g. scaffold_generator.rb)
Hi,
Anyone know where the "record" method is defined. Its used in generators
like in the scaffold generator. An extract from it is below (taken from
scaffold_generator.rb):
def manifest
record do |m|
# Check for class naming collisions.
m.class_collisions controller_class_path,
"#{controller_class_name}Controller",
2023 Jul 19
0
proposal for WRE: clarify that use of S4 classes implies use of superclasses
If a package has
importClassesFrom(P, C)
in its NAMESPACE, then should it _also_ have
importClassesFrom(P, <superclasses of C exported from P>)
importClassesFrom(Q, <superclasses of C exported from Q>)
## and so on
... ? I think that WRE could be more clear on this point, and in any case
I _think_ that the answer is yes.
Notably, I think that this rule would
2006 Apr 21
3
Rails on Pair networks
I''ve been looking to play about with Ruby on Rails for a while just to
see what the fuss is about and now that I have, it looks very
impressive. Unfortunately I can''t seem to get it to run on my shared web
server which is run by the hosting company pair networks (www.pair.com).
I found the handy guide on the wiki that seemed tailor made for my
problems and followed the
2011 May 27
1
Reference Classes/S4 Classes: can method dispatch check superclasses BEFORE resorting to method for "ANY"?
Dear list,
is it possible that method dispatch checks for superclasses/virtual
classes before checking "ANY"?
I'd like to build a generic initialization method for all my Reference
Class (say "MyDataFrame") objects by having them inherit from class, say
"MyRefClassVirtual" (which would have to be a virtual S4 class; there
are no virtual Reference Classes,
2012 May 29
0
virtual superclasses
Dear List,
I'm exploring the use of class inheritance for a package were
developing. I want to try to build on existing a class, i first want to
extend this a bit using a virtual class and then extend this virtual
class in multiple other classes. This would be similar to bar3 in the
example below. Since there are nice functions for creating an object of
the first superclass i would like
2008 Feb 02
0
Adding methods to Object in Rails -- WARNING
I wanted to do:
foo.wrap
and wrap would go to a specialized wrap for some types of foo and a
general Object#wrap for all the others.
So I added wrap to Object
class Object
def wrap
self
end
end
This worked except for objects which are actually AssociationProxy
objects pretending to be some other object. The reason is that
AssociationProxy removes all but a few methods from itself.
2006 Apr 25
2
Bug in Rails 1.1 implementation of before_filters
I just spent a few hours tracking down a bug in Rails 1.1, so I thought
I''d post the issue and a workaround just in case anyone else hits it.
I designed a security enhancement so that controller methods can be
protected by preceding them with a role. The standard Ruby
method_added() callback is used to detect when controller methods are
added, and then I manipulate the
2005 Mar 02
3
uprgrade to 0.10: uninitialized constant Class::Object
Hi,
I installed rails 0.10 with ruby gem, and upgraded my application as
described at http://manuals.rubyonrails.com/read/book/15 .
Now, when accessing the action index of the controller rss_feed, I get
this error in the terminal when I started the server:
#<NameError: uninitialized constant Class::Object>
2006 Apr 20
1
Unable to connect to postgres on Fedora Core 5
I have been struggling for hours trying to connect Rails to postgresql.
I have trawled google results - all to no avail! I have installed the
postgres gem but it doesn''t appear to install properly:
# gem install postgres
Attempting local installation of ''postgres''
Local gem file not found: postgres*.gem
Attempting remote installation of ''postgres''
2006 Feb 11
1
Fastcgi and mysql woes
Hi,
I have been heck of a time to get mysql and fastcgi to
work properly on my Mac OS X box. I keep getting the
following error: Can''t connect to local MySQL server
through socket ''/opt/local/var/run/mysql5/mysqld.sock''
(13)
I have even tried commenting out the "socket" option
in my database.yml but it still gives me the same
error. I''m ok when I