Displaying 20 results from an estimated 6000 matches similar to: "Quick facets hack"
2007 Oct 30
1
Facets and/or Nested Describes
I have to confess that I did not know about facets before reading
Ashley Moran''s post:
http://aviewfromafar.net/2007/10/21/quick-and-dirty-facets-in-rspec-trunk
Not knowing about the facets solution, I made a couple of feature
requests for nested describes:
http://rubyforge.org/tracker/index.php?func=detail&aid=14980&group_id=797&atid=3152
2007 Oct 24
1
Alternate File "require" line in TextMate bundle
Ok, this is INCREDIBLY finicky of me, and I''m a really finicky person
at the best of times, but I noticed that when you use the TM
Alternate File command to create specs, it does it with a header line
like this:
File.dirname(__FILE__) + ''/../../../spec_helper''
I use a header line like this
require File.expand_path(File.join(File.dirname(__FILE__), *%w
[..
2007 Oct 28
4
A better way to stub out constants
Hi
Something that''s gnawing at me... to avoid using the SQLite3 gem I''m
stubbing it out like this:
before(:each) do
@database = mock("SQLite3 database")
SQLite3 = Module.new
SQLite3::Database = Class.new
SQLite3::Database.stub!(:new).and_return(@database)
end
But then it keeps nagging me:
2007 Oct 21
10
Preferred mock framework
Hi
In light of the fact that RSpec mocks are going into maintenance mode
in the near future, I was wondering what everyone was switching to.
I liked the look of FlexMock most, so gave that a shot. However,
there''s a few things that don''t work well with RSpec due to the
traditional differences in the way Test::Unit cases are written vs
RSpec specs. (One spec per
2007 Oct 20
3
TextMate bundle in MacroMates repo
Hi
Recently I sent a modified version of the GetBundle bundle to
textmate-dev. It was failing because the RSpec bundle was from
another repo (ie RubyForge). One of the replies said that the RSpec
bundle was now in the MacroMates repo, which it is. Is that an
officially handled thing? If so, what version of the RSpec bundle is
being maintained there - CURRENT? It''s
2007 Oct 24
3
How do you specify a rubygem is being required?
Hi
I''m loading a gem on demand but can''t find a way to spec it.
Assuming rubygems is already loaded, I assumed the following would work:
describe SqliteConnection, " class" do
it "should require ''sqlite3''" do
Kernel.should_receive(:require).with("sqlite3")
SqliteConnection.new
end
end
Unfortunately
2007 Oct 31
16
Am I missing something with Heckle?
Hi
I can''t get heckle working. In fact, I''ve built an example so simple
that it either shows a bug, or I am being really, REALLY stupid.
Heckle does not appear to support RSpec directly, so I''m trying to use
spec --heckle (RSpec trunk as of 10 mins ago, Heckle 1.4.1). I''ve
constructed this pair of sample files:
18> ~/Desktop/heckle_test % cat
2007 Oct 23
10
How is everyone structuring stories?
Bleeding-edge story-writers,
How are you structuring your specs?
I am working on a new project and tried this:
./lib
./blah
./spec
./blah
./stories
But it breaks autotest, so I moved stories parallel to lib and spec.
Also what about suffixes?
I have adopted "xyz_story_spec.rb", and "xyz.story" for the time
being, with the line
runner =
2007 Nov 01
0
Heckle rake task
Fellow hecklers,
Just spent a while getting this working. Turns out heckle will heckle
a whole module and sub-modules with one call, so with a bit of string
matching, you can build a nice tool to heckle your whole app and
report any failures.
Was going to post to the list, as the first version was about 4 lines
long, but I''ve embellished it slightly (I got carried away), so
2007 Oct 17
15
Any tips on teaching BDD with RSpec?
Hi
I hope this is not OT. I''m training my replacement at work to do BDD
Rails development. He''s done a CS/maths degree but has no
professional programming experience, so he''s never NOT done a project
without BDD. In a way I am jealous of his unspoilt situation :)
I''ve gone about things this way:
* first teach him some Ruby (he did mainly Java at
2007 Oct 21
8
Interesting shared behaviour side-effect
Given the following ApplicationController specs:
describe ApplicationController, "one facet", :shared => true do
it ''foo'' ...
it ''bar'' ...
end
describe ApplicationController, "some other facet", :shared =>
true do
it ''abc'' ...
it ''xyz'' ...
end
describe
2007 Jun 27
2
Controller specs not shareable?
Hi
I just wondered if there was a reason why Rails controller specs are
not shareable? eg
describe "All XHR POSTs to /gap/calculate_quote", :shared => true do
controller_name :gap
# ...
end
describe "XHR POST /gap/calculate_quote with valid details" do
it_should_behave_like "All XHR POSTs to /gap/calculate_quote"
# ...
end
blows up with
2007 Jun 14
4
Can''t run RSpec files in TextMate
Hi
Not sure if this is the place to ask this or not. I''ve upgraded to
RSpec 1.0.5, installed the latest TextMate bundle, but whenever I do
"Run Behaviour Descriptions in selected files/directories" I get this:
/Users/ashleymoran/Library/Application Support/TextMate/Pristine Copy/
Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:18:in `run_files'':
private method
2011 Jun 11
0
problems with geom_vline, histograms, scale=free and facets in ggplot
Dear list,
I?m having a little trouble with adding vertical lines to a histogram.
I need to draw a matrix of histograms (using facets), and in each
histogram add a vertical line indicating the mean value of the data in
each facet. According to the last example in the geom_hline help, to
display different lines in each facet I need to provide a data frame.
I modified this example to make a plot
2011 Oct 11
1
controling text in facets (ggplot2)
Hi R-helpers!
Here is my problem:
I have a graph with 3 different facets where there are 3 different
regression line. My goal is to mention separately in each facet each
equation that describes my lines.
So far, I managed to add a line and the same equation to all my facets but
that's not unfortunately what I want.
Is there a way to do that? Any suggestion would be gladly welcome!
Thanks
2010 Mar 10
0
Color facets by z-level (solved by creating example)
I am having trouble getting my facets colored with "concentric" colors
by z level. This code give a fair representation of my problems
dealing a real dataset
cmtx <- matrix(, nrow=10, ncol=10)
cc <- (row(cmtx)-5)^2 + (col(cmtx)-5)^2
cc
#----------
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 32 25 20 17 16 17 20 25 32 41
[2,]
2007 Aug 21
1
Render template not matching absolute path
Hi
I have a simple controller method like this:
class StylesheetsController < ApplicationController
layout nil
session :off
def gap
site = Site.find_by_hostname(request.host)
@colours = site.colours
respond_to do |accepts|
accepts.css { render :file => "#{RAILS_ROOT}/app/views/
stylesheets/gap.rcss" }
end
end
end
And I want to test that
2013 Oct 12
2
Order of factors with facets in ggplot2
Hello,
I'd like to produce a ggplot where the order of factors within facets is
based on the average of another variable.
Here's a reproducible example. My problem is that the factors are ordered
similarly in both facets. I would like to have, within each facet of `f1',
boxplots for 'x' within each factor `f2', where the boxplots are ordered
based on the average of x
2010 Sep 11
1
Setting scales for ggplot2 with facets
Faceting in ggplot2 seems to permit different scales for different
facets, but I fail
to see how one could control ylim and xlim ranges for each facet
separately.
For instance, I would like to set the ylim = c(0,10) for facet "A"
and ylim = c(42,102) for facet "B". Since the data is out of these
ranges,
setting facet_grid(factor ~ ., scales = "free_y") does not
2007 Nov 08
0
Facets GEM Install on Windows
I keep getting this error when trying to :
gem install facets
C:\projects\rails>gem install facets
ERROR: While executing gem ... (Zlib::BufError)
buffer error
Other gems install fine:
C:\projects\rails>gem environment
RubyGems Environment:
- VERSION: 0.9.4 (0.9.4)
- INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
- GEM PATH:
- c:/ruby/lib/ruby/gems/1.8
- REMOTE