GithubHelp home page GithubHelp logo

Comments (8)

merongivian avatar merongivian commented on August 17, 2024 1

Can confirm. I have the same issue with version '0.7.0.rc.2'

from opal-rspec.

anharu2394 avatar anharu2394 commented on August 17, 2024 1

tha same error occured again.
image

My spec_helper.rb

require "bundler/setup"
require "rubelm"
require "opal-browser"
require 'opal/platform'

RSpec.configure do |config|
  # Enable flags like --only-failures and --next-failure
  config.example_status_persistence_file_path = ".rspec_status"

  # Disable RSpec exposing methods globally on `Module` and `main`
  config.disable_monkey_patching!

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

from opal-rspec.

elia avatar elia commented on August 17, 2024 1

Ok, found a temporary solution

add spec/opal/custom_sprockets_runner.rb with this content:

require 'opal'
require 'opal/platform'
require 'opal/rspec/sprockets_runner'

then replace the main file in config.ru with opal/custom_sprockets_runner.rb


meanwhile I'll fix it on master, let me know how it goes 👍

from opal-rspec.

elia avatar elia commented on August 17, 2024 1

yeah sorry, I got the path wrong 😄

Anyway I pushed the fix to master, you should be able to use the original code by pointing to the github gem in your Gemfile:

gem 'opal-rspec', git: 'https://github.com/opal/opal-rspec', submodules: true

from opal-rspec.

elia avatar elia commented on August 17, 2024

Please try adding a require 'opal/platform' in your spec or spec_helper and see if it works.

from opal-rspec.

anharu2394 avatar anharu2394 commented on August 17, 2024

How is the problem solved?

from opal-rspec.

anharu2394 avatar anharu2394 commented on August 17, 2024

I 'll try it.

from opal-rspec.

anharu2394 avatar anharu2394 commented on August 17, 2024

My config.ru

require 'bundler'
Bundler.require
require 'opal/rspec'
sprockets_env = Opal::RSpec::SprocketsEnvironment.new(spec_pattern='spec/opal/*_spec.{rb,opal}')
run Opal::Sprockets::Server.new(sprockets: sprockets_env) { |s|
  s.main = 'opal/custom_sprockets_runner.rb'
	s.append_path 'spec/opal'
  sprockets_env.add_spec_paths_to_sprockets
  s.debug = false
}

My spec/opal/custom_sprockets_runner.rb

require 'opal'
require 'opal/platform'
require 'opal/rspec/sprockets_runner'

But running bundle exec rackup,the error occured.
RuntimeError: Cannot find asset: opal/custom_sprockets_runner.rb
image

I edit config.ru

require 'bundler'
Bundler.require
require 'opal/rspec'
sprockets_env = Opal::RSpec::SprocketsEnvironment.new(spec_pattern='spec/opal/*_spec.{rb,opal}')
run Opal::Sprockets::Server.new(sprockets: sprockets_env) { |s|
  s.main = 'custom_sprockets_runner'
	s.append_path 'spec/opal'
  sprockets_env.add_spec_paths_to_sprockets
  s.debug = false
}

And, I can successfully run bundle exec rackup
image
image

Thank you very much!!!!!!!!!

from opal-rspec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.