{"action":"created","issue":{"url":"https://api.github.com/repos/troessner/reek/issues/1035","repository_url":"https://api.github.com/repos/troessner/reek","labels_url":"https://api.github.com/repos/troessner/reek/issues/1035/labels{/name}","comments_url":"https://api.github.com/repos/troessner/reek/issues/1035/comments","events_url":"https://api.github.com/repos/troessner/reek/issues/1035/events","html_url":"https://github.com/troessner/reek/pull/1035","id":172918295,"number":1035,"title":"User our Spec matcher everywhere.","user":{"login":"troessner","id":271109,"avatar_url":"https://avatars.githubusercontent.com/u/271109?v=3","gravatar_id":"","url":"https://api.github.com/users/troessner","html_url":"https://github.com/troessner","followers_url":"https://api.github.com/users/troessner/followers","following_url":"https://api.github.com/users/troessner/following{/other_user}","gists_url":"https://api.github.com/users/troessner/gists{/gist_id}","starred_url":"https://api.github.com/users/troessner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troessner/subscriptions","organizations_url":"https://api.github.com/users/troessner/orgs","repos_url":"https://api.github.com/users/troessner/repos","events_url":"https://api.github.com/users/troessner/events{/privacy}","received_events_url":"https://api.github.com/users/troessner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/troessner/reek/labels/ready-for-review","name":"ready-for-review","color":"0e8a16"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-08-24T10:32:34Z","updated_at":"2016-08-30T11:33:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/troessner/reek/pulls/1035","html_url":"https://github.com/troessner/reek/pull/1035","diff_url":"https://github.com/troessner/reek/pull/1035.diff","patch_url":"https://github.com/troessner/reek/pull/1035.patch"},"body":"Fixes #1011 \r\n\r\nWhat I did:\r\n\r\n* Killed all the shared examples\r\n* Introduced our Spec matcher everywhere. This and the bullet point above also have the nice side effect that now all requires at the top of a smell detector spec file look like this:\r\n\r\n```Ruby\r\nrequire_relative '../../spec_helper'\r\nrequire_lib 'reek/smells/irresponsible_module'\r\n````\r\n\r\nAnd that's it. No more references to `Examiner`, `CodeContext` and god knows what else.\r\n\r\n* Removed silly specs. Some areas of Reek are shockingly under-speced whilst others are over-speced. If we have a threshold of 4 x it is just silly to have a spec that 3 x does not smell. And 2 x does not smell. And 1 x does not smell. That's just bloated code.\r\n\r\n* Made our syntax consistent. Removed foo / bar because I honestly can't see that anymore. Introduced heredocs everywhere and removed multi line strings. Introduced newlines. And so on.\r\n\r\n* Introduced the same general examples for every spec at the beginning. Every smell detector spec now starts out like this:\r\n\r\n```Ruby\r\nRSpec.describe Reek::Smells::IrresponsibleModule do\r\n  it 'reports the right values' do\r\n    src = <<-EOS\r\n      class Dummy\r\n      end\r\n    EOS\r\n\r\n    expect(src).to reek_of(described_class,\r\n                           lines:   [1],\r\n                           context: 'Dummy',\r\n                           message: 'has no descriptive comment',\r\n                           source:  'string')\r\n  end\r\n\r\n  it 'does count all occurences' do\r\n    src = <<-EOS\r\n      class Outer\r\n        # Method is necessary because we don't count empty classes.\r\n        def something; end\r\n        class Inner\r\n        end\r\n      end\r\n\r\n    EOS\r\n\r\n    expect(src).to reek_of(described_class,\r\n                               lines:   [1],\r\n                               context: 'Outer')\r\n    expect(src).to reek_of(described_class,\r\n                           lines:   [4],\r\n                           context: 'Outer::Inner')\r\n  end\r\nend\r\n```\r\n\r\nThe 2nd spec 'does count all occurences' is only added when it actually makes sense, so there are some detectors that only start with the first spec above.\r\n\r\n* Removed contexts that didn't make any sense. E.g. I removed non-nested contexts with only example and just updated the example description. Same goes for specs that were covered by one giant context."},"comment":{"url":"https://api.github.com/repos/troessner/reek/issues/comments/243411248","html_url":"https://github.com/troessner/reek/pull/1035#issuecomment-243411248","issue_url":"https://api.github.com/repos/troessner/reek/issues/1035","id":243411248,"user":{"login":"chastell","id":56633,"avatar_url":"https://avatars.githubusercontent.com/u/56633?v=3","gravatar_id":"","url":"https://api.github.com/users/chastell","html_url":"https://github.com/chastell","followers_url":"https://api.github.com/users/chastell/followers","following_url":"https://api.github.com/users/chastell/following{/other_user}","gists_url":"https://api.github.com/users/chastell/gists{/gist_id}","starred_url":"https://api.github.com/users/chastell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chastell/subscriptions","organizations_url":"https://api.github.com/users/chastell/orgs","repos_url":"https://api.github.com/users/chastell/repos","events_url":"https://api.github.com/users/chastell/events{/privacy}","received_events_url":"https://api.github.com/users/chastell/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T11:33:04Z","updated_at":"2016-08-30T11:33:04Z","body":"Thanks for pinging me – this summer for me is streaks of holidays (with a toddler…) interspersed with streaks of very intensive work; thanks for keeping me on the team. :)\r\n\r\nI have a slight preference for explicit smell names (over `described_class`), because they read a tiny bit better (the brain does not have to do the dereferencing), which is a win over a more _proper_ constant extraction. But I’m OK with either.\r\n\r\nAs for names, I’d love to have (a) consistency and (b) something better than both `x`/`y` and `foo`/`bar` – and I really like the `alpha`/`bravo`/`charlie` scheme for some reason. ;)\r\n\r\n![Master of Orion espionage](https://masteroforion.eu/uploads/filer_public/3b/bc/3bbc5d8e-9510-4b04-98a2-09101930d789/espionage_spies_window_large.jpg)"}}
{"actor":{"display_login":"chastell"}}