Comments (8)
Can confirm. I have the same issue with version '0.7.0.rc.2'
from opal-rspec.
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.
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.
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.
Please try adding a require 'opal/platform'
in your spec or spec_helper and see if it works.
from opal-rspec.
How is the problem solved?
from opal-rspec.
I 'll try it.
from opal-rspec.
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
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
Thank you very much!!!!!!!!!
from opal-rspec.
Related Issues (20)
- Compiler/Line Number Metadata HOT 4
- Performance Improvement Ideas HOT 4
- issues with opal 0.10.0 HOT 4
- Results Reporting Sync/Async HOT 1
- filter_run_excluding not working? HOT 1
- how to require gem or a source file ? HOT 5
- stub_const doesn't work quite the same in opal 0.9 HOT 9
- Opal-Master Compatibility
- Sprockets HOT 1
- Support random order HOT 2
- Opal::RSpec::RakeTask HOT 4
- `expect_any_instance_of` is not working when using opal master HOT 5
- Trying to run phantomjs or in-browser tests throws Sprockets::FileNotFound HOT 3
- Get ` cannot load such file -- rake` when run test in browser. HOT 2
- Could not found jquery when use node as task runner. HOT 1
- spec not worked with opal 0.11. (chrome headless) HOT 11
- Unable to require 'nodejs' in spec HOT 2
- Headless Chrome support HOT 3
- Can you release a new version? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opal-rspec.