opal-rspec icon indicating copy to clipboard operation
opal-rspec copied to clipboard

RSpec update - basically a whole repo refactor

Open hmdne opened this issue 2 years ago • 2 comments

Ref: opal/opal#2440 Fixes #39

This still needs some finishing touches, but basically the idea is to drop compatibility with anything below upcoming Opal 1.6.

$ bundle exec rake
...
Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Opal::RSpec::RakeTask with a block forwards the block to Runner#command
     # Temporarily skipped with xit
     # ./spec/opal/rspec/rake_task_spec.rb:21

  2) spec_opts requires and format 
     # Temporarily skipped with xit
     # ./spec/integration/spec_opts_spec.rb:76

  3) RSpec specs: Mocks runs correctly
     # Temporarily skipped with xit
     # ./spec/integration/verify_rspec_specs_spec.rb:44


Top 10 slowest examples (109.13 seconds, 82.3% of total time):
  RSpec specs: Core runs correctly
    24.98 seconds ./spec/integration/verify_rspec_specs_spec.rb:26
  Opal::RSpec::RakeTask exits with the result of #run
    19.35 seconds ./spec/opal/rspec/rake_task_spec.rb:9
  browser formatter matches test results
    17.73 seconds ./spec/integration/browser_spec.rb:20
  Opal::RSpec::BrowserFormatter matches test results
    17.68 seconds ./spec/opal/rspec/browser_formatter_spec.rb:18
  RSpec specs: Expectations runs correctly
    14.94 seconds ./spec/integration/verify_rspec_specs_spec.rb:38
  RSpec specs: Diff-LCS runs correctly
    3.83 seconds ./spec/integration/verify_rspec_specs_spec.rb:50
  RSpec specs: Support runs correctly
    3.68 seconds ./spec/integration/verify_rspec_specs_spec.rb:32
  spec_opts empty is expected to match /1 example, 0 failures/
    2.32 seconds ./spec/integration/spec_opts_spec.rb:68
  spec_opts color set is expected to match /\x1B\[32m1\ example,\ 0\ failures\x1B\[0m/
    2.31 seconds ./spec/integration/spec_opts_spec.rb:9
  Verify spec-opal/other dummy_spec.rb using Rake task runs correctly
    2.3 seconds ./spec/integration/verify_other_specs_spec.rb:14

Top 10 slowest example groups:
  browser formatter
    17.73 seconds average (17.73 seconds / 1 example) ./spec/integration/browser_spec.rb:3
  Opal::RSpec::BrowserFormatter
    17.68 seconds average (17.68 seconds / 1 example) ./spec/opal/rspec/browser_formatter_spec.rb:3
  Opal::RSpec::RakeTask
    9.67 seconds average (19.35 seconds / 2 examples) ./spec/opal/rspec/rake_task_spec.rb:6
  RSpec specs:
    9.49 seconds average (47.44 seconds / 5 examples) ./spec/integration/verify_rspec_specs_spec.rb:3
  Verify spec-opal/other
    2.23 seconds average (4.46 seconds / 2 examples) ./spec/integration/verify_other_specs_spec.rb:3
  spec_opts
    2.03 seconds average (18.3 seconds / 9 examples) ./spec/integration/spec_opts_spec.rb:4
  Opal Specs
    1.52 seconds average (7.62 seconds / 5 examples) ./spec/integration/verify_opal_specs_spec.rb:3
  Opal::RSpec::CachedEnvironment
    0.00125 seconds average (0.00748 seconds / 6 examples) ./spec/opal/rspec/cached_environment_spec.rb:6
  Opal::RSpec::Runner
    0.00083 seconds average (0.01744 seconds / 21 examples) ./spec/opal/rspec/runner_spec.rb:7
  Opal::RSpec::SprocketsEnvironment
    0.0006 seconds average (0.00181 seconds / 3 examples) ./spec/opal/rspec/sprockets_environment_spec.rb:5

Finished in 2 minutes 12.6 seconds (files took 0.40116 seconds to load)
62 examples, 0 failures, 3 pending

Tests status:

  context 'Core' do
    it 'runs correctly', gem_name: 'rspec-core' do
      expect_results_to_be('1622 examples, 0 failures, 391 pending')
    end
  end

  context 'Support' do
    it 'runs correctly', gem_name: 'rspec-support' do
      expect_results_to_be('181 examples, 0 failures, 32 pending')
    end
  end

  context 'Expectations' do
    it 'runs correctly', gem_name: 'rspec-expectations' do
      expect_results_to_be('1798 examples, 0 failures, 371 pending')
    end
  end

  context 'Mocks' do
    xit 'runs correctly', gem_name: 'rspec-mocks' do
      expect_results_to_be('1683 examples, 9 failures, 495 pending')
    end
  end

  context 'Diff-LCS' do
    it 'runs correctly', gem_name: 'diff-lcs' do
      expect_results_to_be('272 examples, 0 failures')
    end
  end

hmdne avatar Oct 04 '22 21:10 hmdne

This fixes #39

hmdne avatar Oct 04 '22 21:10 hmdne

I also thought about bumping version to 1.6 to denote Opal 1.6 is the first supported version.

hmdne avatar Oct 04 '22 21:10 hmdne