These are chat archives for opal/opal

16th
May 2016
Mitch VanDuyn
@catmando
May 16 2016 14:36
@wied03 (or anybody else)
trying to restrict which rspecs run based on tags.
normal rspec I can do this:
RSpec::Core::RakeTask.new('ruby:rspec') do |s|
  s.rspec_opts = "--tag ruby"
end
but opal-rspec seems to only allow these things to get set via the command line, and I am not sure I can even set tags?
This message was deleted
Brady Wied
@wied03
May 16 2016 14:39
@catmando -
RSpec.configure do |config|  
  config.filter_run_including focus: true
  config.run_all_when_everything_filtered = true
end
Mitch VanDuyn
@catmando
May 16 2016 14:39
The problem I am trying to solve is allowing specs to simply have a :ruby or :opal tag on them (instead of adding the extra if opal? around them. Just a minor thing, but...
Brady Wied
@wied03
May 16 2016 14:40
you can do something like that
Mitch VanDuyn
@catmando
May 16 2016 14:40
in opal rspec?
Brady Wied
@wied03
May 16 2016 14:40
yep, I use that to focus in on tests but you could use it for that purpose as well
Mitch VanDuyn
@catmando
May 16 2016 14:41
not sure I see how that filters out anything...
Brady Wied
@wied03
May 16 2016 14:41
I'm pretty sure fit, fdescribe, fcontext, which I use that for that, just add an implicit focus: true tag on their respective examples/example groups
Mitch VanDuyn
@catmando
May 16 2016 14:41
but I tried this already:
  RSpec.configure do |config|
    config.include React::SpecHelpers
    config.filter_run_excluding :ruby => true
  end
and that does not work... (it just runs everything)
@wied03 there is no way just to set the tag in the rake config block?
RSpec::Core::RakeTask.new('ruby:rspec') do |s|
  s.rspec_opts = "--tag ruby"
end
Brady Wied
@wied03
May 16 2016 14:43
there are certain options that I've implemented, but they have to be dealt with 1 by 1 right now
opal/opal-rspec#41
Mitch VanDuyn
@catmando
May 16 2016 14:44
gotcha, so in the meantime?
Brady Wied
@wied03
May 16 2016 14:44
what you're doing should work, but the RSpec specs that test some of that can't run very easily
can you do me a favor and replicate the filter_run_excluding problem in a simple test case outside your project, then I can have a look at it ?
Mitch VanDuyn
@catmando
May 16 2016 14:46
yes no problem...
Brady Wied
@wied03
May 16 2016 14:51
cool. if you could just throw it up as an opal-rspec defect when you're done then
that would be great
Mitch VanDuyn
@catmando
May 16 2016 14:59
@wied03 I don't know why I am being so dumb today, but I can't find the specs in opal-rspec... I was just going to create a test spec for you.
at any rate here is project that reproduces:
I was just starting to add specs to this, so its nice and simple...
clone that branch, run bundle exec rake.
Mitch VanDuyn
@catmando
May 16 2016 15:14
@wied03 Deepest apologies.. I was just being pants-on-head backwards... exclude is working fine...
Mitch VanDuyn
@catmando
May 16 2016 21:56
if I compile this string:
"require 'foobar'"
is there someway to get what the required file list is?
Elia Schito
@elia
May 16 2016 22:00
>> require 'opal'
=> true
>> c = Opal::Compiler.new('require "foobar"')
=> #<Opal::Compiler:0x007fc62bb10988 @source="require \"foobar\"", @indent="", @
unique=0, @options={}>
>> c.compile; c.requires
=> ["foobar"]
>>
@catmando ^
Mitch VanDuyn
@catmando
May 16 2016 22:01
thank you!
Elia Schito
@elia
May 16 2016 22:02
:)