Skip to content

Commit

Permalink
Group opal specs and rubyspec specs together when running mspec
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 25, 2013
1 parent bbf284e commit 1ffe037
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 0 additions & 5 deletions spec/ospec/main.rb.erb
Expand Up @@ -16,10 +16,5 @@
<% end %>
<% end %>

<% File.read('spec/rubyspecs').split("\n").reject(&:empty?).each do |s| %>
<% require_asset s %>
<% end %>

# All specs have been run, so we notify mspec that we are done
OSpecRunner.main.did_finish

12 changes: 11 additions & 1 deletion tasks/mspec.rake
Expand Up @@ -52,7 +52,7 @@ class RunSpec
def initialize(file=nil)
Opal::Processor.arity_check_enabled = true

ENV['OPAL_SPEC'] = file.nil? ? ["#{Dir.pwd}/spec/"].join(',') : file.join(',')
ENV['OPAL_SPEC'] = self.specs_to_run(file).join(',')

build_specs

Expand All @@ -78,6 +78,16 @@ class RunSpec
Process.wait
end

def specs_to_run(file=nil)
# add custom opal specs from spec/
specs = file.nil? ? ["#{Dir.pwd}/spec/"] : file

# add any rubyspecs we want to run (defined in spec/rubyspecs)
specs.push File.read('spec/rubyspecs').split("\n").reject(&:empty?)

specs
end

def build_specs
SpecEnvironment.new.build
end
Expand Down

0 comments on commit 1ffe037

Please sign in to comment.