Displaying 20 results from an estimated 10000 matches similar to: "RSpec with Rails but without any database"
2007 Jan 04
8
Common setup code and naming specifications
Hello!
I have a lot of contexts for testing Rails controllers, that must do
something like ''session[:logged_in] = true'' in their setup. How can this
be refactored? In unit tests I would simply create a
LoggedInControllerTest base class, that all my functional tests would
derive from.
And another small question:
In my controller specifications I often have to decide whether to
2007 Jul 24
4
Rspec on rails with out database?
Hi all,
I am trying to use rspec_on_rails in a Rails app that doesn''t have a
database. so far I have just been faking it out by dumping in a
sqlite3 database just to make Rails happy.
I was using for test::unit a rake task that eliminated the calls to
database prep:
# Added this .rake file to keep Rake happy without a database.
# Remove once a database is in the picture.
2006 May 07
1
rake test without database
Hi!
Is it possible to run unit tests when no database is configured?
Rails recipes mentions putting following piece of code in a file within
lib/tasks/
[:test_units,:test_functional,:recent].each do |name|
Rake::Task.lookup(name).prerequisites.clear
end
However this seem to be out-of-date, as task lookup in rake according to
RDoc is now done using Rake:Task[name]. But after I updated the
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2007 Jan 19
3
Something cool I learned about rspec today
I found an awesome feature today. When you''re setting expectations,
you can actually pattern match the parameters to methods. Here''s my
discussion and example:
http://evang.eli.st/blog/2007/1/19/parameter-matching-in-rspec
Pat
2011 Dec 03
1
Reading multiple text files and then combining into a dataframe
I have a multiple text files, separated by a single space, that I need to
combine into a single data.frame. Below is the track I'm on using
list.files to capture the names of the files and then lapply with
read.table. But I run into problems making a usable dataframe out of the
data.
#Creating example data in similar format to data I have
sub <- rep(1,10)
trial <- seq(1,10,1)
size
2006 Dec 27
2
DB-less rspec_on_rails
Hi!
I''m still struggling with RSpec to get it working with a Rails
application, that does not use a database. I removed all the db:*
dependencies from the RSpec targets, but it still wants to connect to a
database.
Any ideas?
bye,
Tobias
** Execute spec:models
/usr/bin/ruby1.8 -I"/var/lib/gems/1.8/gems/rspec-0.7.5/lib"
2006 Jan 09
2
Using SQL to get a whole record when using aggregate functions
I have a table with some data structured something like this:
book
----
title (varchar)
pages (int)
completed_on (date)
While I can find the shortest book completed in each year with
something like this:
select min( pages ), year from book group by year
I would also like to get the title of the shortest book in each year.
Is there any way to do this by modifying the previous query to pull
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives
2007 Sep 03
20
Reason for _spec.rb convention
Hi
Easy one - I just wondered why all spec files for rspec_on_rails end
"_spec.rb" instead of just ".rb"? They are all inside the spec
folder so surely the fact they are specs is implicit?
Ashley
2011 Aug 05
1
matrix into vector with vertex names
Using Igraph, I create shortest paths, then convert the matrix into
three column vectors - "vertex1", "vertex2", "shortestpath" - as the
code below shows.
#code for generating shortest path matrix and creating a 3 columns
from an igraph graph object "y"
y_s<-shortest.paths(y, weights = NULL)
y_s <- melt(y_s)[melt(upper.tri(y_s))$value,] #Step 2: this
2009 Mar 09
10
Cucumber - RSpec matcher
I must be missing something obvious here but I cannot seem to see it.
I have this step definition:
When /entity named "(.*)" has a legal name "(.*)"/ do |name, legal|
myentity = Entity.find_by_entity_common_name!(name.hll_keycase)
myentity.entity_legal_name.should equal legal.hll_keycase
end
Which fails with this:
And the entity named "Myuser" has a legal
2008 Jun 03
9
Build rspec-rails as a gem?
I can''t figure out how to build rspec-rails as a gem when just cloned
from github... there isn''t any .gemspec file or rake task that does
this. Any help?
--
Posted via http://www.ruby-forum.com/.
2007 Aug 06
0
[LLVMdev] Spillers
Hi, David.
Spill intervals must be precolored because they can't be spilled once more.
They are the shortest intervals precisely over each def/use of the original
interval. That is why they also have their weights set to #INF.
Imagine that on a second iteration allocation algorithm figures out that
some spilled interval can't be assigned a physical register. Allocator can't
spill it
2017 Jun 20
2
Problem with shortestPath in igraph and qgraph
hello,
I have a graph and i use qgraph package to calculate centrality parameters.
Now I want to know the maximum value of shortest path for each vertex with
discarding the Inf value in short pathes. For this I use the
ShortestPathLengths of centrality function in qgraph. but when I want to
get the maximum the result is wrong. here is my code:
cen<-centrality(Q)
2008 Jan 23
5
Changing rspec directory structure
I''d like to change the rspec directory structure from
/spec
/model
/controllers
etc
to
/spec
/unit
/models
/controllers
/lib
/functional
/models
/controllers
etc.
Basically the Jay Fields style of testing -- I want the unit tests to
be run all the time on a continuous integration server, but the
integration/functional and system tests to be run
2008 May 23
12
Modules will no longer be automatically included in RSpec version 1.1.4
Can anyone (David?) shed some light on what exactly this warning is
complaining about? I started seeing it when I upgraded to Rails 2.1
RC1 and the latest RSpec from git.
I''m getting it in some helper specs that I''m writing. And yes, I am
including a module there, to reuse some utility methods I originally
wrote for my controller tests (I''m switching to specs
2008 May 27
4
Failing rspec story not causing a CruiseControl.rb build to fail?
We''ve just added rspec stories to our CruiseControl.rb build. When there''s a failing scenario we see the failure in the log output, but it doesn''t cause the CruiseControl build to fail. We''ve also just upgraded to the latest rspec version, 1.1.4, which fixes rspec bug 228, but the CC.rb build is still passing.
Has anyone got failing rspec stories making
2008 Mar 20
1
minimum distances
Hi,
I have a question about computing shortest Euclidean distances between
two data frames of spatial points...
I have 2 dataframes (not yet converted to spatial class)
>Sewers<-data.frame(x=c(10,20,35,50),y=c(100,150,200,300))
>transect <- data.frame(x=seq(from=0, to=50, by=1),y=seq(from=100,
to=150, by=1))
I would like to be able to compute the shortest distance from the
2008 Aug 24
3
Igraph library: How to calculate APSP (shortest path matrix) matrix for a subset list of nodes.
Dear R Users,
I have a network of 25000 total nodes and a list of 500 node which is a
subset of all nodes. Now I want to calculate the APSP (all pair shortest
path) matrix only for these 500 nodes.
I would appreciate any help.
Thanks in advance
Dinesh
--
Dinesh Kumar Barupal
Research Associate
Metabolomics Fiehn Lab
UCD Genome Center
451 East Health Science Drive
GBSF Builidng
University of