{"action":"created","issue":{"url":"https://api.github.com/repos/exercism/xruby/issues/149","labels_url":"https://api.github.com/repos/exercism/xruby/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/exercism/xruby/issues/149/comments","events_url":"https://api.github.com/repos/exercism/xruby/issues/149/events","html_url":"https://github.com/exercism/xruby/pull/149","id":80702629,"number":149,"title":"Make acronym table-driven","user":{"login":"kytrinyx","id":276834,"avatar_url":"https://avatars.githubusercontent.com/u/276834?v=3","gravatar_id":"","url":"https://api.github.com/users/kytrinyx","html_url":"https://github.com/kytrinyx","followers_url":"https://api.github.com/users/kytrinyx/followers","following_url":"https://api.github.com/users/kytrinyx/following{/other_user}","gists_url":"https://api.github.com/users/kytrinyx/gists{/gist_id}","starred_url":"https://api.github.com/users/kytrinyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kytrinyx/subscriptions","organizations_url":"https://api.github.com/users/kytrinyx/orgs","repos_url":"https://api.github.com/users/kytrinyx/repos","events_url":"https://api.github.com/users/kytrinyx/events{/privacy}","received_events_url":"https://api.github.com/users/kytrinyx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-25T23:19:59Z","updated_at":"2015-05-25T23:52:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/exercism/xruby/pulls/149","html_url":"https://github.com/exercism/xruby/pull/149","diff_url":"https://github.com/exercism/xruby/pull/149.diff","patch_url":"https://github.com/exercism/xruby/pull/149.patch"},"body":"This may or may not be a good idea. It's not very idiomatic Ruby, but\r\nin this case I think that it's very easy to read, and serves well as documentation."},"comment":{"url":"https://api.github.com/repos/exercism/xruby/issues/comments/105338382","html_url":"https://github.com/exercism/xruby/pull/149#issuecomment-105338382","issue_url":"https://api.github.com/repos/exercism/xruby/issues/149","id":105338382,"user":{"login":"kotp","id":16747,"avatar_url":"https://avatars.githubusercontent.com/u/16747?v=3","gravatar_id":"","url":"https://api.github.com/users/kotp","html_url":"https://github.com/kotp","followers_url":"https://api.github.com/users/kotp/followers","following_url":"https://api.github.com/users/kotp/following{/other_user}","gists_url":"https://api.github.com/users/kotp/gists{/gist_id}","starred_url":"https://api.github.com/users/kotp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotp/subscriptions","organizations_url":"https://api.github.com/users/kotp/orgs","repos_url":"https://api.github.com/users/kotp/repos","events_url":"https://api.github.com/users/kotp/events{/privacy}","received_events_url":"https://api.github.com/users/kotp/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T23:52:39Z","updated_at":"2015-05-25T23:52:39Z","body":"I do this in my [LearnRubyByTesting](https://bitbucket.org/kotp/learnrubybytesting/src/b8fdf81a9289e4986f544ccbcfc2b5ad6a81d5ea/test/core_ruby_string_spec.rb?at=master) repository.  The way that it is done still documents individual tests (When I use Spec reporter) and has messages for failures as appropriate. so the data used to test (and message) is all in one place and it looks like a table.\r\n\r\nI like it.  I have linked to the full test above so you can peek.  Around lines (153..-1)\r\n\r\n```ruby\r\n describe 'Formatting' do\r\n\r\n    Formatting_code_and_result.each do |format_code, value, result, comment|\r\n      it \"must format '%#{format_code}' % #{comment || value} to '#{result}'\" do\r\n        (\"%#{format_code}\" % value).must_equal result\r\n      end\r\n    end\r\n\r\n  end\r\n\r\nend\r\n\r\nBEGIN {\r\n  Formatting_code_and_result = [\r\n    ##  fields are:\r\n    #format_code, value,   expected_result, failure comment\r\n    ['b',    42,              '101010'              ],\r\n    ['B',    42,              '101010'              ],\r\n    ['s',    'string',        'string'              ],\r\n    ['d',    42,              '42'                  ],\r\n    ['i',    42,              '42'                  ], # Identical to d format code above\r\n    ['u',    42,              '42'                  ], # Identical to d format code above\r\n    ['05d',  42,              '00042'               ],\r\n    ['5d',   42,              '   42'               ],\r\n    ['o',    42,              '52'                  ], # convert to octal\r\n    ['x',    42,              '2a'                  ],\r\n    ['X',    42,              '2A'                  ],\r\n    ['e',    42,              '4.200000e+01'        ],\r\n    ['9.2e', 42,              ' 4.20e+01'           ],\r\n    ['E',    42,              '4.200000E+01'        ],\r\n    ['9.2E', 42,              ' 4.20E+01'           ],\r\n    ['g',    42,              '42'                  ],\r\n    ['g',    42123,           '42123'               ],\r\n    ['9.2g', 42,              '       42'           ],\r\n    ['9.2g', 42**-2,          '  0.00057', '42**-2' ],\r\n    ['9.2g', 42**-3,          '  1.3e-05', '42**-3' ],\r\n    ['9.2g', 42** 2,          '  1.8e+03', '42** 2' ],\r\n    ['9.2G', 42** 4,          '  3.1E+06', '42** 4' ], # Hard to spot, but this capitalizes the E\r\n    ['f',    42,              '42.000000'           ],\r\n    ['.2f',  42,              '42.00'               ],\r\n    ['.5a',  1,               '0x1.00000p+0'        ], # Figured this out.  Checkout 1024, it shows p as a binary to power of 10\r\n    ['.5a',  1024,            '0x1.00000p+10'       ],\r\n  ]\r\n}\r\n```\r\n"}}