Displaying 17 results from an estimated 17 matches for "test_foo".
2010 Sep 16
1
[LLVMdev] Linking shared library
...ucture 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
LIBS += -lfoo
When I build the tool:
# (cd tool && make)
llvm[0]: Compiling test_foo.cc for Debug build
llvm[0]: Linking Debug executable test_foo
... undefined reference ...
collect2: ld returned 1 exit status
Which means that the libfoo...
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 Files\R\rw2011\bin\R.exe" --no-save < test > out.txt
the file "c:/temp...
2005 Jul 22
3
testing application_helper.rb
...in application_helper.rb.
Here is my app/test/functional/helpers.rb
require File.dirname(__FILE__) + ''/../test_helper''
require File.dirname(__FILE__) + ''/../../app/helpers/application_helper''
class HelpersTest < Test::Unit::TestCase
def setup
end
def test_foo
result = foo( "test parameter 1" )
assert_equal true, result
end
end
However, I get method not found errors (it can''t find foo()) when
trying to run the test. What am I doing wrong?
Similarly, how does one go about functional testing application.rb?
Thanks.
Matt
2006 Feb 04
1
RUnit - need advice on a good directory structure or tips...
...ite
files in the same directory.
But the best solution is the way to get the path to the file of the current
file.
BTW, here is an example. I welcome any kind of advice.
==============================================
There are three files. Two are in the "tests"
directory(suite_foo.r test_foo.r), and the other one is in the "codes"
directory (foo.r).
In your R prompt, do "setwd("path to test directory")" and then do
"source("suite_foo.r")" to run tests.
==============================================
###################################...
2007 May 30
0
DRYing up controller tests and mailer tests using superclasses
...les how tests using those superclasses will
look:
http://pastie.caboo.se/66139
Ticket with the patch:
http://dev.rubyonrails.org/ticket/8521
Known issues:
* Since we don''t explicitly setup the @request and @response objects
anymore, we should probably show how to use them in the dummy test_foo
method. Could be something like:
def test_foo
@request.host = "foo.bar.com"
assert true
...
end
* The creation of the method_added-method in ControllerTest and
MailerTest should probably be DRYed up and put into RailsTest.
In any case, feedback on this is appreciated.
Thanks!
C...
2007 Nov 08
1
Running tests from another test case
I''m in the position that would be really useful for me to run in a
testcase a test belonging to another testcase.
Assuming I do not want to use modules, how could I do that?
My code would be something like this:
class MyTestCase < Test::Rails:TestCase
def myTest
matc = MyAnotherTestCase.new
end
end
The code above seems to work but when I run MyTestCase all the tests
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:
http://beautifulpixel.com/articles/2006/08/04/all-fixtures-plugin
It works by simply scanning the fixtures directory for *.yml files, and
converts it to an array of symbols that gets passed to the fixtures
method. Performan...
2007 Jul 26
5
Test errors without verification
I''m not sure if this is by design, but I''ve stumbled across this a
few times trying to debug my own tests. If an assertion fails the
test, and a mock expectation was to blame, the test''s failure / error
messages don''t give enough info. I''ve had to resort to
def teardown
mocha_verify
end
which just gets tedious.
I''ve created a patch
2005 Apr 17
14
Leaky Webrick (?) & image corruption
Hi guys,
After a few days of webrick seeming to use up a ton of ram (the longer it was running, the more ram); izayoi on #rubyonrails kindly suggested changing Dependencies.mechanism in development.rb to :require which appears to have fixed the prob - at the expense of having to restart webrick after making changes to .rb files. Is this a known issue, or is there an alternative solution?
2006 Feb 10
0
Functional testing - why can you use session[:key] but not session[:key]= ?
Question''s all in the title..
def test_foo
assert_equal ''foo'', session[:bar] # Perfectly valid
end
def test_blowup
session[:bar] = foo # TypeError: Symbol as array index
...
end
I always create a @session variable in the setup method. Just curious
as to why you can get session values but not set them using sessio...
2007 Dec 24
1
Uninitialized constant in integration test
I am seeing weird issues when trying to create integration tests. Here
is a very simple example of something that is failing. The
assert_redirected_to, and other methods, fail with this or similar
exceptions.
I have tried requiring both ''application'' and ''listings_controller'', but
neither solves this problem, although the exception changes.
Anybody know
2007 Jul 25
3
autotest + integration testing (follow_redirect!) error
...t!''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/integ
ration.rb:547:in `send''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/integ
ration.rb:547:in `method_missing''
./test/integration/new_user_test.rb:20:in `test_foo''
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/integ
ration.rb:453:in `run''
At this point I''d guess it''s something going on with how the db''s get
cloned/purged but honestly am too much of a novice to guess much
further past...
2007 Mar 18
5
Automatically mocking ActiveRecord methods
Seems like I do a fair amount of mocking ActiveRecord''s automatically
generated routines when I''m testing controllers. Things like:
@portalspace = PortalSpace.new :public_readable => true,
:public_writable => true, :name => ''public''
@portalspace.stubs(:id).returns(203)
PortalSpace.stubs(:find).with(203).returns(@portalspace)
2008 Feb 11
6
Should I Test My Fixtures?
I have a number of fixtures in my test suite. For example, with
acts_as_authenticated and acts_as_state_machine, I created a number of
users in different account states for use in functional testing.
(Suspended users can not log in, etc)
Is it a good idea to run fixtures through tests to ensure that they
conform to their ideals?
EG: assert users(:suspended_user).suspended?
If so, where should
2008 May 20
7
Expect with "real world" returns?
Is there a way to do something like this?
class Foo
def self.hello(name)
"Hello #{name}!"
end
end
Foo.expects(:bar).with("Carl").once
assert_equal "Hello Carl!", Foo.hello
Basically, my problem is that once you set an expectation, the
original code is never executed and is not tested. However, it''s
still very useful to set expectations to
2007 Nov 18
8
helper methods starting with should
Hi all,
As an experiment in playing nice with others, we''ve added the ability
in rspec''s trunk to do this:
class ThingExamples < Spec::ExampleGroup
def should_do_stuff
...
end
end
This is how rspec 0.1 worked, and for people already comfortable with
the classes/methods approach of Test::Unit, it is a more comfortable
entry point to rspec.
For others, however, it
2006 Jun 06
14
How can I set the session in a functional test?
Hey :)
I need to simulate a login in my functional test, otherwise I can''t GET nor
POST to the action.
I need to set the session key "logged_in_user_id".
I tried this inside the setup() method:
session[''logged_in_user_id''] = 1
But that throws: TypeError: can''t convert String into Integer
Any ideas?
Thanks,
Rob
-------------- next part