Re: [rspec-users] Monitor method invoking from superclass

2010-09-30 Thread Andrew Wagner
Rick, could you elaborate on this? I'm curious, how would you use a shared example group here, given his sample code? My first thought was to use ancestors to get the parent class, and re-define the 'a' method there to do something simple and observable, and then test that. Is that evil? On Thu,

[rspec-users] What should I test/specify?

2010-10-30 Thread Andrew Wagner
Ok, so here's the scenario. I have a top-level module, with a method called load_file. It should take a file name, get the YAML module (Syck) to parse it, and then send the result to a class, which should convert that result into a series of objects. I'm not sure what specs, if any, I should write

Re: [rspec-users] What should I test/specify?

2010-10-30 Thread Andrew Wagner
On Sat, Oct 30, 2010 at 12:46 PM, David Chelimsky wrote: > On Oct 30, 2010, at 11:40 AM, Andrew Wagner wrote: > > > Ok, so here's the scenario. I have a top-level module, with a method > called load_file. It should take a file name, get the YAML module (Syck) to > pars

Re: [rspec-users] What should I test/specify?

2010-10-30 Thread Andrew Wagner
Yeah, that's about what I figured, thanks. This is what I came up with: require 'spec_helper.rb' require 'yaml' describe "BTree" do describe ".load_file" do context "when the file exists" do before(:all) { File.open("test_file.yaml", 'w') {|f| } } after(:all) { File.delete "test

Re: [rspec-users] What should I test/specify?

2010-10-30 Thread Andrew Wagner
On Sat, Oct 30, 2010 at 9:54 PM, Andrew Premdas wrote: > On 30 October 2010 14:40, Andrew Wagner wrote: > >> Ok, so here's the scenario. I have a top-level module, with a method >> called load_file. It should take a file name, get the YAML module (Syck) to >> parse

[rspec-users] Shared contexts

2010-11-16 Thread Andrew Wagner
Suppose we have this class: class MarbleMachine def insert color # process marble of color 'color' end def press button # process a push of the given button end def output # compute a result end end Let's presume here that the machine takes any number of marbles in any o

Re: [rspec-users] Shared contexts

2010-11-17 Thread Andrew Wagner
a few different, but related, contexts like the ones I've put in shared examples. Ideally, I'd like to figure out how to make these contexts composable in some way, because the actions they're comprised of are composable. On Tue, Nov 16, 2010 at 1:07 PM, Andrew Wagner wrote: > Sup

[rspec-users] "unit" vs. "functional" specs

2010-12-10 Thread Andrew Wagner
I went back and forth on whether to send this to this list or the ruby-talk list, so feel free to tell me to take a hike... I'm working on a personal project where I'm trying to keep a really high bar on quality. One of the ways I'm doing that is to stick very close to the BDD/TDD cycle as suggest

[rspec-users] Current test failing?

2011-02-11 Thread Andrew Wagner
Is there any way, within a test (e.g., in an after block), to see whether the test is currently passing, failing, or pending? Even a hack-ish kind of way? I'm just curious. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailma

Re: [rspec-users] it_behaves_like and running single examples

2011-02-17 Thread Andrew Wagner
To diagnose this, I would start to try to isolate the problem as much as possible. Get it all the way down to one file, outside of rails, with one test that exemplifies the behavior, if need be. And if you get to that point and still see the strangeness...send us a pastebin of it :) On Wed, Feb 16

Re: [rspec-users] Controller testing - it doesn't print if given some print value

2011-05-21 Thread Andrew Wagner
What does your actual spec look like? On Wed, May 18, 2011 at 10:04 AM, DKR wrote: > I am working on Rspec2.5.0 with rails 3.0.6 . And I was successfully > able to complete model testing. But when I come to controller part I > wanted to see whether some variable getting generated & I have given