{"id":15061660,"url":"https://github.com/nishants/look_like","last_synced_at":"2025-10-18T11:31:54.107Z","repository":{"id":56882225,"uuid":"68462499","full_name":"nishants/look_like","owner":"nishants","description":"RSpec matchers for writing wireframe tests.","archived":false,"fork":false,"pushed_at":"2016-12-12T04:55:48.000Z","size":111,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T08:21:17.848Z","etag":null,"topics":["cucumber","currency","dark-server-testing","data-integration","fresh-deployments","rspec-matchers","ruby","test-automation","wireframe-testing"],"latest_commit_sha":null,"homepage":"","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/nishants.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}},"created_at":"2016-09-17T16:04:02.000Z","updated_at":"2018-05-17T09:50:53.000Z","dependencies_parsed_at":"2022-08-20T13:00:49.994Z","dependency_job_id":null,"html_url":"https://github.com/nishants/look_like","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishants%2Flook_like","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishants%2Flook_like/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishants%2Flook_like/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishants%2Flook_like/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nishants","download_url":"https://codeload.github.com/nishants/look_like/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154998,"owners_count":21056542,"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":["cucumber","currency","dark-server-testing","data-integration","fresh-deployments","rspec-matchers","ruby","test-automation","wireframe-testing"],"created_at":"2024-09-24T23:23:22.261Z","updated_at":"2025-10-18T11:31:53.998Z","avatar_url":"https://github.com/nishants.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# look_like matcher [![Build Status](https://travis-ci.org/nishants/look_like.svg?branch=master)](https://travis-ci.org/nishants/look_like) [![Coverage Status](https://coveralls.io/repos/github/nishants/look_like/badge.svg?branch=master)](https://coveralls.io/github/nishants/look_like?branch=master) [![Gem Version](https://badge.fury.io/rb/look_like.svg)](https://badge.fury.io/rb/look_like)\n\n- This gem is a collection of rspec matchers, for writing wireframe tests.\n- Such tests search for visual clues for detecting presence of a bug.\n- Useful for writing sanity tests in higher environments, e.g. testing your fresh deploy to production.\n- These can reuse your code for regression tests.  \n- Meaningful assertion reports help in quick diagnosis of faults. \n- For example you can write test for fresh deployments to make sure the currency and language are correct by domain/user. \n- [Try online] (http://amoeba.social/lab/look-like/)\n\n## Installation\n\n- Add this line to your application's Gemfile:\n```ruby\ngem 'look_like'\n```\n\n- To your spec_helper/test_helper or env.rb for cucumber, add following : \n```ruby\nrequire \"look_like\"\n```\n\n\n- And then execute:\n```bash\n$ bundle install\n```\n\n## Usage\n```ruby\nactual   = [[\"one@two.xyz\"  ,  \"₹300,20\", \"yes\"],\n            [\"two@three.com\",  \"₹301,20\", \"no\" ],\n            [\"one@two.xyz\"  ,  \"₹121,20\", \"\"   ]]\n            \nexpected = [[\"email\", \"₹amount\", \"yes/no*\"]]\n\nexpect(actual).to look_like(expected)  \n```\n\n[Try online here](http://amoeba.social/lab/look-like/index.html#/Rows)\n## Custom Matchers\n```ruby\n\nLookLike::Matchers.define({\n  :name     =\u003e :my_custom_matcher,\n  :desc     =\u003e \"my custom matcher\",\n  :select   =\u003e lambda{|expected|\n     # return true if this matcher must be used for given expectation.\n  },\n  :match    =\u003e lambda{|actual, expected|\n     # return true if actual matches expected\n  } \n})\n```\n[Examples for defining matchers] (https://github.com/nishants/look_like/tree/master/lib/look_like/matchers).\n\n\n## Writing Wireframe Tests with Cucumber\n- Suppose this is how an html table look like :\n\n| Name       | Email         | Commission | Enrolled | HomePage                                      |\n|------------|---------------|------------|----------|-----------------------------------------------|\n| User One   | user1@abc.com | $5,008.00  | yes      | https://www.facebook.com/profile.php?id=76273 |\n| User Two   | user2@abc.com | $493.00    | no       |                                               |\n| User Three | user3@abc.com | $8.00      | yes      | https://www.facebook.com/profile.php?id=76273 |\n\n- In your feature file, define the table rows   \n```gherkin\nScenario: View employees detail table\n  Given I am an admin\n  Then  I should see employees table like\n        |name      |email     |  $amount  | yes/no | url* |\n```\n\n- In your steps, get table rows as array of array\n```ruby\nThen(/^I should see employees table like$/) do |definition|\n  rows = homepage.open.employee_table_rows\n  expect(rows).to look_like(definition.rows)\nend\n```\n\n## List of Matchers\n- [**Email**] (http://amoeba.social/lab/look-like/#/Email)\n```ruby\nexpect(\"one@two.xyz\").to look_like(\"email\")\nexpect(\"one@two.xyz\").to look_like(\"a@b.com\")\n```\n\n- [**Amount and Currency**](http://amoeba.social/lab/look-like/#/Amount%20and%20Currency)\n```ruby\nexpect(\"$53,23,1\").to look_like(\"$amount\")\nexpect(\"₹23,1.00\").to look_like(\"₹amount\")\n\nexpect(\"$53,23,1\").to look_like(\"$12.21\")\nexpect(\"₹23,1.00\").to look_like(\"₹100.12\")\n```\n\n- [**Enums**](http://amoeba.social/lab/look-like/#/Enums)\n```ruby\nexpect(\"one\").to look_like(\"one/two/three\")\nexpect(\"four\").not_to look_like(\"one/two/three\")\n```\n\n- [**Regex**](http://amoeba.social/lab/look-like/#/Regex)\n```ruby\nexpect(\"1-12-1-2\").to look_like(\"/[\\\\d\\\\-]+/\")\nexpect(\"$3.67\").to look_like(\"/\\\\$(?\u003cdollars\u003e\\\\d+)\\\\.(?\u003ccents\u003e\\\\d+)/\")\nexpect(\"$367\").not_to look_like(\"/\\\\$(?\u003cdollars\u003e\\\\d+)\\\\.(?\u003ccents\u003e\\\\d+)/\")\n```\n\n- [**URL**](http://amoeba.social/lab/look-like/#/URL)\n```ruby\nexpect(\"google.com\").to look_like(\"http://google.com\")\nexpect(\"http://google.com\").to look_like(\"http://google.com\")\nexpect(\"google-com\").not_to look_like(\"http://google.com\")\n```\n\n- [**Wildcard**](http://amoeba.social/lab/look-like/#/Wildcard)\n```ruby\nexpect(\"\").to look_like(\"email*\")\nexpect(\"not.an.email\").not_to look_like(\"email*\")\nexpect(\"one@two.xyz\").to look_like(\"email*\")\n\nexpect(\"one@two.xyz\").to look_like(\"a@b.com*\")\n\nexpect(\"\").to look_like(\"*\")\nexpect(\"any-thing\").to look_like(\"*\")\n```\n\n- [**Numbers**](http://amoeba.social/lab/look-like/#/Numbers)\n```ruby\nexpect(\"5000\").to look_like(\"number\")\nexpect(\"5,000\").to look_like(\"number\")\nexpect(\"5,43.11\").to look_like(\"number\")\n\nexpect(\"6993\").to look_like(\"5000\")\nexpect(\"5000\").to look_like(\"5,000\")\nexpect(\"$5000\").not_to look_like(\"5000\")\n```\n\n- [**Date and Time**](http://amoeba.social/lab/look-like/#/Date%20and%20Time)\n```ruby\nexpect(\"12/13/2014\").to look_like(\"date\")\nexpect(\"12/13/2014\").to look_like(\"DD/MM/YYYY\")\nexpect(\"06/21/1987\").to look_like(\"12/13/2014\")\n\nexpect(\"1994-11-05T08:15:30-05:00\").to look_like(\"timestamp\")\nexpect(\"2014-12-31 T 11:59:13\").to look_like(\"YYYY-MM-DD T HH:MM:SS\")\nexpect(\"2014-12-31 T 11:59:13\").to look_like(\"YYYY-MM-DD T hh:mm:ss\")\nexpect(\"1994-11-05T08:15:30-05:00\").to look_like(\"2011-02-05T18:23:30-05:00\")\n\n```\n\n- [**Arrays**](http://amoeba.social/lab/look-like/index.html#/Arrays)\n```ruby\nactual   = [\"one@two.xyz\",  \"₹300,20\", \"\"]\nexpected = [\"email\"      , \"₹amount\" , \"*\"]\nexpect(actual).to look_like(expected)\n```\n\n- [**Rows**](http://amoeba.social/lab/look-like/index.html#/Rows)\n```ruby\nactual   = [[\"one@two.xyz\"  ,  \"₹300,20\", \"yes\"],\n            [\"two@three.com\",  \"₹301,20\", \"no\" ],\n            [\"one@two.xyz\"  ,  \"₹121,20\", \"\"   ]]\nexpected = [[\"email\", \"₹amount\", \"yes/no*\"]]\n\nexpect(actual).to look_like(expected)\n```\n\n\n## Development\n- After checking out the repo, run `bin/setup` to install dependencies. \n- Then, run `rake spec` to run the tests. \n- You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n- To install this gem locally, run `bundle exec rake install`. \n- To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`\n- Release task  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- Build report : https://travis-ci.org/nishants/look_like\n- Coverage report : https://coveralls.io/github/nishants/look_like\n\n## Contributing\n- Report bugs or suggest improvements at https://github.com/nishants/look_like/issues.\n- Pull requests are highly welcome at at https://github.com/nishants/look_like. \n\n## License\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishants%2Flook_like","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnishants%2Flook_like","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishants%2Flook_like/lists"}