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

Multiple output roots (e.g spec/javascript) would be awesome #7

Closed
superchris opened this issue Oct 11, 2010 · 7 comments
Closed

Multiple output roots (e.g spec/javascript) would be awesome #7

superchris opened this issue Oct 11, 2010 · 7 comments
Assignees

Comments

@superchris
Copy link

I'd like to TDD my coffee script so it would be awesome if maybe frameworks could specify their own output directories so I can have one for jasmine that maps spec/coffeescripts to spec/javascripts. I'll take a look a forking and adding this and send a pull request if I get anywhere.

@netzpirat
Copy link

I use guard-coffeescript for exactly that reason. This gives you also the possibility to have a headless BDD workflow, that would not be based on requests to Rails and thus impossible to implement with the Rack bases approach of Barista.

Of course I still use Barista for the Rails integration.

@rsim
Copy link

rsim commented Jan 21, 2011

I have patched Jasmine gem ("rake jasmine" task) to use Barista to recompile all changed CoffeeScript files in app/coffeescripts and spec/coffeescripts before running tests - see https://groups.google.com/d/msg/jasmine-js/FcNpK1UkNiw/SeUkZi-pPlwJ

Currently I needed to set directly output directory instance variable
https://gist.github.com/790479#LID21
It would be good if there would be setter method for this.

@elcuervo
Copy link

rsim i'm trying to use your script but rake jasmine fails with "no such file to load -- spec/javascripts/support/jasmine_config.rb" with ruby 1.9

@rsim
Copy link

rsim commented Jan 26, 2011

jasmine gem has generated file spec/javascripts/support/jasmine_runner.rb which has lines

jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
require jasmine_config_overrides if File.exists?(jasmine_config_overrides)

Can you debug it and find out why spec/javascripts/support/jasmine_config.rb is not loaded by these lines?

@javierv
Copy link

javierv commented Feb 9, 2011

Hi rsim. I've got the same problem elcuervo does under Ruby 1.9 (works fine under Ruby 1.8).

Apparently it doesn't have anything to do with those lines. Removing them or deleting every line in spec/javascripts/support/jasmine_runner.rb results in the same error.

It seems to have nothing to do with your script either, but with the existence of that file

ls spec/javascripts/support/jasmine_config.rb 
ls: spec/javascripts/support/jasmine_config.rb: (doesn't exist)
rake jasmine
(works fine)
touch spec/javascripts/support/jasmine_config.rb 
rake jasmine --trace
rake aborted!
no such file to load -- spec/javascripts/support/jasmine_config.rb
gems/ruby-1.9.2-p136/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
gems/ruby-1.9.2-p136/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `block in require'
gems/ruby-1.9.2-p136/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `block in load_dependency'
gems/ruby-1.9.2-p136/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:596:in `new_constants_in'
gems/ruby-1.9.2-p136/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:225:in `load_dependency'
gems/ruby-1.9.2-p136/gems/activesupport-3.0.4/lib/active_support/dependencies.rb:239:in `require'
gems/ruby-1.9.2-p136/gems/jasmine-1.0.1.1/lib/jasmine/tasks/jasmine.rake:34:in `block (2 levels) in <top (required)>'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:636:in `call'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:631:in `each'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:607:in `block in invoke_prerequisites'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:604:in `each'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:596:in `block in invoke_with_call_chain'
rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
gems/ruby-1.9.2-p136/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
gems/ruby-1.9.2-p136/bin/rake:19:in `load'
gems/ruby-1.9.2-p136/bin/rake:19:in `<main>'

@javierv
Copy link

javierv commented Feb 9, 2011

Apparently, line 34 in lib/jasmine/tasks/jasmine.rake should read:
require File.join(Rails.root, jasmine_config_overrides) if File.exist?(jasmine_config_overrides)

In order to work with Ruby 1.9.

P.S: sorry for spamming this issue with questions about Jasmine.

@ghost ghost assigned Sutto Apr 13, 2011
@Sutto
Copy link
Owner

Sutto commented Apr 18, 2011

Ok, so we finally have proper support for per-framework output_roots - Simply use Barista.change_output_root! or the :output_root option on registering a framework.

Cheers!

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

6 participants