{"id":13503845,"url":"https://github.com/opal/opal-spec","last_synced_at":"2025-04-14T19:32:08.911Z","repository":{"id":3224964,"uuid":"4260315","full_name":"opal/opal-spec","owner":"opal","description":"Deprecated Spec library for Opal","archived":false,"fork":false,"pushed_at":"2014-10-15T22:30:08.000Z","size":508,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T07:51:12.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://opalrb.org","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-08T12:12:12.000Z","updated_at":"2019-07-09T11:34:20.000Z","dependencies_parsed_at":"2022-08-19T01:01:05.536Z","dependency_job_id":null,"html_url":"https://github.com/opal/opal-spec","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opal","download_url":"https://codeload.github.com/opal/opal-spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248945961,"owners_count":21187420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T23:00:46.484Z","updated_at":"2025-04-14T19:32:08.893Z","avatar_url":"https://github.com/opal.png","language":"Ruby","readme":"# Deprecated\n\n**`opal-spec` is no longer maintained, see [opal-rspec](http://github.com/opal/opal-rspec)\ninstead.**\n\n# opal-spec\n\nopal-spec is a minimal spec lib for opal, inspired by RSpec and MSpec.\nIt is designed to run on [opal](http://opalrb.org), and provides the\nbare minimum to get specs running.\n\n## Writing Specs\n\nYour specs should go into the `/spec` directory of your app. They take\nthe same form as rspec/mspec:\n\n```ruby\ndescribe MyClass do\n  it 'should do some feature' do\n    1.should == 1\n  end\n\n  it 'does something else' do\n    nil.should be_nil\n    false.should be_false\n    true.should be_true\n  end\nend\n```\n\n### Supported notations\n\n````\n* describe \"foo\" do ... end\n* it \"should foo\" do ... end\n* before do ... end\n* after do ... end\n* let(:foo) { ... }\n* async  # see below\n\n* obj.should == other\n* obj.should != other\n* obj.should be_nil\n* obj.should be_true\n* obj.should be_false\n* obj.should be_kind_of(klass)\n* obj.should eq(other)  # compare with :==\n* obj.should equal(other)  # compare with :equal?\n* obj.should raise_error\n* obj.should be_empty\n* obj.should respond_to(method)\n\n* obj.should_not xxx\n```\n\n###  Async examples\n\nExamples can be async, and need to be defined as so:\n\n```ruby\ndescribe 'MyClass' do\n  # normal, sync example\n  it 'does something' do\n    #...\n  end\n\n  # async example\n  async 'does something else too' do\n    #...\n  end\nend\n```\n\nThis just marks the example as being async. To actually handle the async\nresult, you also need to use a `run_async` call inside some future handler:\n\n```ruby\nasync 'HTTP requests should work' do\n  HTTP.get('users/1.json') do |response|\n    run_async {\n      response.ok?.should be_true\n    }\n  end\nend\n```\n\nThe end of the block passed to `run_async` informs opal-spec that you are\ndone with this test, so it can move on.\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal%2Fopal-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopal%2Fopal-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal%2Fopal-spec/lists"}