Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate configuration for autotest #10

Closed
dchelimsky opened this issue Mar 12, 2010 · 11 comments
Closed

generate configuration for autotest #10

dchelimsky opened this issue Mar 12, 2010 · 11 comments

Comments

@dchelimsky
Copy link
Contributor

Add an option to the rspec command to configure a project directory for autotest, and eliminate the autospec command. Something like:

rspec --configure autotest

This would generate autotest/discover.rb, which would tell autotest that this is an rspec project.

@dchelimsky
Copy link
Contributor Author

Chad and Kabari are working on this (rspec hackfest FTW).

@dchelimsky
Copy link
Contributor Author

Nobody is working on this now, so if anybody else wants to, just add a comment here that you're doing so.

@justinko
Copy link
Contributor

I got this one.

@justinko
Copy link
Contributor

David, I sent you a pull request before realizing you'd rather have "pull requests" pasted here. I'll do that from now on.

@dchelimsky
Copy link
Contributor Author

@dchelimsky
Copy link
Contributor Author

Hey Justin - I applied your patch and got a syntax error

lib/rspec/core/command_line_configuration.rb:51: syntax error, unexpected $end, expecting kEND (SyntaxError)

After addressing that, all the specs and cukes passed, but when I tried it on the command line with a pre-existing autotest/discover.rb, I got this:

/Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/lib/rspec/core/command_line_configuration.rb:29:in `create_discover_file': undefined local variable or method `optionally_remove_discover_file' for RSpec::Core::CommandLineConfiguration::Autotest:Class (NameError)

Wanna take another shot?

@justinko
Copy link
Contributor

Fixed: http://github.com/justinko/rspec-core/commit/81d2be8

Question. Since aruba cannot cover the "gets" method, should I test it with RSpec doing something like this?: http://technicalpickles.com/posts/a-pattern-for-using-standard-in-and-out-in-your-ruby-code/

Thanks David.

@dchelimsky
Copy link
Contributor Author

@justinko - No need to modify the design like that. This isn't java :) You can stub gets right on the object:

interactor = Interactor.new
interactor.stub(:gets).and_return("this")
interactor.method_that_adds_and_that_to_gets.should eq("this and that")

I generally try avoid stubbing methods on the subject of an example, but I'd probably go for the tradeoff here.

@dchelimsky
Copy link
Contributor Author

I applied your patch (from 2 comments back) and got the same syntax error, and then got this after fixing it and trying to run:

lib/rspec/core/backward_compatibility.rb:20:in `const_missing': uninitialized constant RSpec::Core::Parser::CommandLineConfiguration (NameError)

@justinko
Copy link
Contributor

I'm getting no errors with HEAD. I created another clean branch, try using this one:

http://github.com/justinko/rspec-core/commit/ff5770e

@dchelimsky
Copy link
Contributor Author

timcharper pushed a commit to timcharper/rspec-core that referenced this issue Aug 19, 2011
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants