{"id":18879958,"url":"https://github.com/opal/opal-rspec-rails","last_synced_at":"2026-02-19T17:31:55.399Z","repository":{"id":66260491,"uuid":"48594463","full_name":"opal/opal-rspec-rails","owner":"opal","description":"bindings between `opal-rails` and `opal-rspec`","archived":false,"fork":false,"pushed_at":"2017-03-05T01:25:33.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-15T22:04:33.363Z","etag":null,"topics":["browser","javascript","opal","rails","rspec","ruby","ruby-on-rails","testing"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-12-26T00:07:24.000Z","updated_at":"2021-01-01T23:30:04.000Z","dependencies_parsed_at":"2024-01-23T21:20:57.355Z","dependency_job_id":"9ad7892a-b0d3-4e26-b01e-e7a1b1ad746d","html_url":"https://github.com/opal/opal-rspec-rails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opal/opal-rspec-rails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-rspec-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-rspec-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-rspec-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-rspec-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opal","download_url":"https://codeload.github.com/opal/opal-rspec-rails/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-rspec-rails/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29624582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","javascript","opal","rails","rspec","ruby","ruby-on-rails","testing"],"created_at":"2024-11-08T06:40:47.460Z","updated_at":"2026-02-19T17:31:55.370Z","avatar_url":"https://github.com/opal.png","language":"Ruby","readme":"# Opal::RSpec::Rails\n\nProvides bindings between `opal-rails` and `opal-rspec`.\nSupports in browser specs as well as a rake task.\n\n## Installation\n\nAdd this line to your Rails application's Gemfile:\n\n```ruby\ngem 'opal-rspec-rails', github: 'opal/opal-rspec-rails'\n```\n\nAnd then execute:\n\n    $ bundle\n\n\n## Usage\n\nLet's say you have a library named `MyLib` in your Opal app.\n\n```ruby\n# /app/assets/javascripts/my_lib.js.rb\nclass MyLib\n  def does_something\n    \"running\"\n  end\nend\n```\n\nSetup code can be put in a `spec_helper` as usual in the `spec-opal` folder:\n\n_**BEWARE:** Rails style autoload doesn't work here, so you have to require `my_lib`._\n\n```ruby\n# /spec-opal/spec_helper.js.rb\nrequire 'my_lib'\nrequire 'support/some_spec_helper'\n\nRSpec.configure do |config|\n  config.before(:all) { puts \"before all hook\"}\n  config.include SomeSpecHelper\nend\n```\n\nSpecs go into `/spec-opal`\n\n```ruby\n# /spec-opal/my_lib_spec.js.rb\nrequire 'spec_helper'\n\ndescribe MyLib do\n  it 'does something' do\n    MyLib.new.does_something.should =~ /run/\n  end\nend\n```\n\nYou can now run your specs by visiting `http://localhost:3000/spec-opal` on your app (`rails server`) or using the command line with `rake opal:spec`.\n\n![1 examples, 0 failures](http://cl.ly/2j0N0R0C1c1f/Screen%20Shot%202016-01-02%20at%2000.26.43.png)\n\n\n## Configuration (Rails side)\n\n```ruby\n# Enable or disable opal-rspec support, usually it's disabled in production.\nconfig.opal_rspec.enable = ::Rails.env.development? || ::Rails.env.test?\n\n# The path at which the embedded spec runner is mounted in your application.\nconfig.opal_rspec.routing_path = '/spec-opal'\n\n# The spec dir on the file system, relative from `Rails.root`.\nconfig.opal_rspec.spec_location = 'spec-opal'\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/opal/opal-rspec-rails.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal%2Fopal-rspec-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopal%2Fopal-rspec-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal%2Fopal-rspec-rails/lists"}