Sha256: 1f482762ab05d98b62c606b2e4d1cd463ac7554c823bdfdc31bd6e3df7394e87

Contents?: true

Size: 927 Bytes

Versions: 3

Compression:

Stored size: 927 Bytes

Contents

require 'rake'

# Run the jasmine tests by running the jasmine:ci rake command and parses the output for failures.
# The spec will fail if any jasmine tests fails.
describe "Jasmine" do
  it "expects all jasmine tests to pass" do
    load_rake_environment ["#{jasmine_path}/lib/jasmine/tasks/jasmine.rake"]
    jasmine_out = run_task 'jasmine:ci'
    if jasmine_out.include? "0 failures"
      js_specs_count = Dir['spec/javascripts/**/*_spec.js*'].count
      puts "#{jasmine_out.match(/\n(.+) specs/)[1]} jasmine specs run (in #{js_specs_count} jasmine test files)"
    else
      puts "\n\n************************  Jasmine Output *************"
      puts jasmine_out
      puts "************************  Jasmine Output *************\n\n"
    end
    expect(jasmine_out).to include "0 failures"
    expect(jasmine_out).to_not include "\n0 specs"
  end
end

def jasmine_path
  Gem.loaded_specs['jasmine'].full_gem_path
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sufia-7.0.0.beta3 spec/javascripts/jasmine_spec.rb
sufia-7.0.0.beta2 spec/javascripts/jasmine_spec.rb
sufia-7.0.0.beta1 spec/javascripts/jasmine_spec.rb