{"id":19520101,"url":"https://github.com/brett-richardson/rspec-situations","last_synced_at":"2025-02-26T00:22:47.743Z","repository":{"id":9367757,"uuid":"11223310","full_name":"brett-richardson/rspec-situations","owner":"brett-richardson","description":"Adds a super simple method to describe RSpec situations in terms of smaller situation blocks.","archived":false,"fork":false,"pushed_at":"2013-12-27T00:36:55.000Z","size":686,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T13:34:01.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://brett-richardson.github.io/rspec-situations","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/brett-richardson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-06T19:32:59.000Z","updated_at":"2013-12-27T00:36:55.000Z","dependencies_parsed_at":"2022-09-22T16:32:13.961Z","dependency_job_id":null,"html_url":"https://github.com/brett-richardson/rspec-situations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brett-richardson%2Frspec-situations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brett-richardson%2Frspec-situations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brett-richardson%2Frspec-situations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brett-richardson%2Frspec-situations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brett-richardson","download_url":"https://codeload.github.com/brett-richardson/rspec-situations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240768102,"owners_count":19854388,"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-11-11T00:23:49.174Z","updated_at":"2025-02-26T00:22:47.670Z","avatar_url":"https://github.com/brett-richardson.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/brett-richardson/rspec-situations.png?branch=master)](https://travis-ci.org/brett-richardson/rspec-situations)\n\nUsing Rspec Situations\n======================\n\nUsing Rspec Situations is super simple.\n\n\nIn your Gemfile:\n```ruby\ngroup :development, :testing do\n  gem 'rspec-situations'\nend\n```\n\n\nIn your spec_helper.rb:\n```ruby\nrequire 'rspec/situations'\n```\n\n\nDefine a situation with the 'situation' method.\nAdd a symbol key to identify the situation, and add an optional description if you like, and pass in a block creating the situation.\n\n\nDescribe a set of 1 or more situations with the 'describe_situation' method, and treat it just like a normal describe call.\n\n\n```ruby\ndescribe Apple do\n  subject( :apple ){ create :apple }\n\n  situation( :bought ){ subject.bought_by = create :user }\n  situation( :red    ){ subject.color = :red }\n\n  situation( :one_yr_old, 'a year old' ) do # With optional description\n    subject.created_at = 1.years.ago\n  end\n\n  describe_situation :bought, :red do\n    it{ should be_tasty }\n  end\n\n  desribe_situation :bought, :one_yr_old, 'bought a year ago' do # With optional description\n    it{ should_not be_tasty }\n  end\n\n  describe_situation :bought, :one_yr_old do\n    it{ should_not be_tasty }\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrett-richardson%2Frspec-situations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrett-richardson%2Frspec-situations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrett-richardson%2Frspec-situations/lists"}