Re: [rspec-users] Best Practice for Controllers

2011-01-21 Thread David Kahn
On Mon, Jan 17, 2011 at 1:43 PM, David Chelimsky wrote: > On Jan 17, 2011, at 10:16 AM, David Kahn wrote: > > On Mon, Jan 17, 2011 at 9:48 AM, Ants Pants wrote: > >> Hello all, >> >> From what I've seen, this type of question doesn't really seem to get an >> answer on this list as most of the repl

Re: [rspec-users] No command 'rspec' found

2011-01-21 Thread wolf volpi
Thanks Richard. Adding the home .gem/ruby/1.8 path did not help. I have rspec version 2 installed. How do I make sure version 1 is not installed? Here is a copy&paste from my terminal: ~$ printenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/wolf/.gem/ru

Re: [rspec-users] Best Practice for Controllers

2011-01-21 Thread Andrew Premdas
On 18 January 2011 12:28, Phillip Koebbe wrote: > > > > On 17 January 2011 20:43, David Chelimsky wrote: > > > > > On Jan 17, 2011, at 10:16 AM, David Kahn wrote: > > > > > On Mon, Jan 17, 2011 at 9:48 AM, Ants Pants >wrote: > > > > >> Hello all, > > > > >> From what I've seen, this type of que

Re: [rspec-users] major release required?

2011-01-21 Thread Luis Lavena
On Tue, Jan 18, 2011 at 11:15 AM, David Chelimsky wrote: > > [...] > > I think the right thing to do is to rely on the autotest plugin, but I also > think that this would require a 3.0 release, which feels a bit grand for this > situation. My question to you is: do you think this warrants a majo

Re: [rspec-users] 'require'ing files from other directories

2011-01-21 Thread Andrew Premdas
On 21 January 2011 21:15, Matt Wynne wrote: > > On 21 Jan 2011, at 16:22, Brian Warner wrote: > > > Matt Wynne wrote in post #976412: > >> On 20 Jan 2011, at 19:32, Brian Warner wrote: > >> > >>> I have a file in step_definitions that's giving me an error for an > >>> uninitialized constant. My g

Re: [rspec-users] major release required?

2011-01-21 Thread Andrew Premdas
On 21 January 2011 13:56, David Chelimsky wrote: > On Jan 19, 2011, at 6:48 AM, Rick DeNatale wrote: > > > On Tue, Jan 18, 2011 at 1:31 PM, David Chelimsky > wrote: > >> > >> On Jan 18, 2011, at 11:08 AM, Rick DeNatale wrote: > >> > >>> On Tue, Jan 18, 2011 at 9:15 AM, David Chelimsky > wrote:

Re: [rspec-users] Feedback Requested (pretty please)

2011-01-21 Thread Andrew Premdas
On 6 January 2011 20:39, Ants Pants wrote: > I have dabbled with RSpec with the Beta books but am only now getting my > teeth in to it. Because of this and because I have no one to ask/bounce > ideas off, I am asking for a kind soul to look at what I've done for my > first example. Am I on the ri

Re: [rspec-users] 'require'ing files from other directories

2011-01-21 Thread Matt Wynne
On 21 Jan 2011, at 16:22, Brian Warner wrote: > Matt Wynne wrote in post #976412: >> On 20 Jan 2011, at 19:32, Brian Warner wrote: >> >>> I have a file in step_definitions that's giving me an error for an >>> uninitialized constant. My guess is I need to 'require' the file where >>> that class i

Re: [rspec-users] Test Spies for RSpec 2

2011-01-21 Thread Tom Stuart
If the idea of having to say 'stubs(:method)' for every method that you're going to call and verify, give my new mocking library Matahari a go: https://github.com/mortice/matahari It's brand new and deficient in many ways but I'm planning on improving it and it sounds like we appreciate the sa

Re: [rspec-users] 'require'ing files from other directories

2011-01-21 Thread Brian Warner
Matt Wynne wrote in post #976412: > On 20 Jan 2011, at 19:32, Brian Warner wrote: > >> I have a file in step_definitions that's giving me an error for an >> uninitialized constant. My guess is I need to 'require' the file where >> that class is defined. Said files is located in /lib/codebreaker. >>

Re: [rspec-users] Test Spies for RSpec 2

2011-01-21 Thread JDeville
Scott, check out Bourne. It's an add on to mocha that gives you spies. I'm using it, and like it a lot. On Dec 2 2010, 8:53 am, David Chelimsky wrote: > On Dec 2, 2010, at 1:44 AM, Scott Bellware wrote: > > > I've tried three test spy mocking frameworks for RSpec that I know of. > > Presently,

Re: [rspec-users] autotest giving error when having shared example in specs

2011-01-21 Thread Rob Westgeest
Thanks for your fast reply David, > > The rake task requires spec/**/*.spec > > Close, but not quite. The default pattern is spec/**/*_spec.rb. Typo sorry > > > Autotest rspec2 requires spec/**/* > > Again, this incorrect. Autotest fires off shell commands that include a list > of files to load

[rspec-users] Arrange Act Assert (AAA) style syntax for rspec2

2011-01-21 Thread JDeville
I'd like to be able to test w/ this methodology, and i'm having trouble figuring out where to hook in to rspec to do it. Near as I can tell, the flow is this: run all of the before filters in the order of highest to lowest context <<-- I need to run something right here run tests run all of t

Re: [rspec-users] major release required?

2011-01-21 Thread David Chelimsky
On Jan 19, 2011, at 6:48 AM, Rick DeNatale wrote: > On Tue, Jan 18, 2011 at 1:31 PM, David Chelimsky wrote: >> >> On Jan 18, 2011, at 11:08 AM, Rick DeNatale wrote: >> >>> On Tue, Jan 18, 2011 at 9:15 AM, David Chelimsky >>> wrote: Hi all, Since the release of rspec-2.0, I've

Re: [rspec-users] Problem with before(:all)

2011-01-21 Thread Wilker
if you wanna share variables from before filters to specs, you need to use instance variables instead of local ones, example: WRONG: before :all do myvar = 1 end it "should do something" do puts myvar # nil end RIGHT: before :all do @myvar = 1 end it "should do something" do puts @myv

[rspec-users] Problem with before(:all)

2011-01-21 Thread Rich Price
I have a module with two methods for marshaling objects. The following rspec code is used to test this module: - Start Code - require '../code/fmutil.rb' require '../code/fmgrid.rb' require '../code/serial.rb' # start test of Serial Module describe Serial do describe "Given a grid wi

Re: [rspec-users] Rspec2 partial view gives nil:NilClass. Why?

2011-01-21 Thread David Chelimsky
On Jan 21, 2011, at 4:43 AM, poseid wrote: > On Jan 16, 10:46 am, poseid wrote: >> Hello, >> >> I am trying to get going with development of view components with >> Rspec2 and Rails3. >> However, I make the following observation, and I don't understand what >> is going on, and how to fix this. >>

Re: [rspec-users] parse!: invalid option "--autotest"

2011-01-21 Thread David Chelimsky
On Jan 19, 2011, at 3:53 PM, Sean McCleary wrote: > I keep getting the error every time I try to run my specs with "bundle > exec rake spec": > > /Users/sean/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.4.0/lib/rspec/ > core/option_parser.rb:18:in `parse!': invalid option: --autotest > (OptionParser

Re: [rspec-users] autotest giving error when having shared example in specs

2011-01-21 Thread David Chelimsky
On Jan 21, 2011, at 4:57 AM, Rob Westgeest wrote: > On Nov 22 2010, 9:42 pm, LesFreeman wrote: >> On Sep 28, 10:42 pm, Amiruddin Nagri wrote: >> >>> I am having asharedexample'allow authorized actions' for my Rails 3 RSpec >>> 2.beta.20 application. Thesharedexamplelooks like >> >>> share_exam

[rspec-users] parse!: invalid option "--autotest"

2011-01-21 Thread Sean McCleary
I keep getting the error every time I try to run my specs with "bundle exec rake spec": /Users/sean/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.4.0/lib/rspec/ core/option_parser.rb:18:in `parse!': invalid option: --autotest (OptionParser::InvalidOption) from /Users/sean/.rvm/gems/ruby-1.9.2

Re: [rspec-users] autotest giving error when having shared example in specs

2011-01-21 Thread Rob Westgeest
I am having the same problem. Autotest with rspec seem to differ from rspecs rake task in which files to automatically require. The rake task requires spec/**/*.spec Autotest rspec2 requires spec/**/* As I am sharing example groups in their own files names (shared_*_examples.rb), and require the

Re: [rspec-users] No command 'rspec' found

2011-01-21 Thread Rich Price
Make sure that version 1 of rspec is NOT installed! Here is my path: /home/rich/.gem/ruby/1.8:/var/lib/gems/1.8:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin On 01/20/2011 03:51 PM, wolf volpi wrote: I installed rspec on Linux Ubuntu 10.04, but no command 'rspec' is found. Perh

Re: [rspec-users] Rspec2 partial view gives nil:NilClass. Why?

2011-01-21 Thread poseid
The problem is probably due to assignment of the photo attachment. I got a unit test working with: test "the partial" do design = Design.new :photo => File.new(Rails.root + "test/ fixtures/images/rails.png") p design.photo(:medium) render :partial => "main/design", :locals => { :d