codetriage / docs_doctor

http://docsdoctor.org
27 stars 21 forks source link

Add sorting of doc_methods on a repo by documentation status #24

Open thenickcox opened 9 years ago

thenickcox commented 9 years ago

This commit adds sorting on a repo between documented and undocumented methods, via a simple UI.

Closes #21.

thenickcox commented 9 years ago

The build failed, but I stashed my changes, and it still failed, so I don't believe the failure is related to my commit.

thenickcox commented 9 years ago

While I'm waiting, I'll see if I can determine the cause of the failing test. Should be able to look into this in the next day or two.

prathamesh-sonpatki commented 9 years ago

@thenickcox Looks like the test was failing all the time. d34c68a3 is the commit that added this test.

git checkout  d34c68a3
rake test
...
Finished in 14.695983s, 0.2722 runs/s, 0.4763 assertions/s.

  1) Failure:
ParsersYardTest#test_parses_threaded [/Users/prathamesh/Projects/sources/docs_doctor/test/parsers/yard_test.rb:13]:
Expected: 29
  Actual: 27

  2) Failure:
UserTest#test_User#subscribe_docs [/Users/prathamesh/Projects/sources/docs_doctor/test/models/users_test.rb:21]:
"User.find(1).doc_assignments.count" didn't change by 1.
Expected: 1
  Actual: 2

4 runs, 7 assertions, 2 failures, 0 errors, 0 skips
thenickcox commented 9 years ago

@prathamesh-sonpatki Fixed it. It was an issue with the way I wrote the fixture data. Looks like it's good to merge, should you so desire.

prathamesh-sonpatki commented 9 years ago

Interesting, what was the difference in fixtures?

thenickcox commented 9 years ago

@prathamesh-sonpatki I get different output on that commit:

$ git checkout d34c68a3
$ rake test
Run options: --seed 36707

# Running:

.Cloning into 'threaded'...
remote: Counting objects: 248, done.
remote: Total 248 (delta 0), reused 0 (delta 0), pack-reused 248
Receiving objects: 100% (248/248), 35.46 KiB | 0 bytes/s, done.
Resolving deltas: 100% (123/123), done.
Checking connectivity... done.
F..

Finished in 2.588068s, 1.5456 runs/s, 2.7047 assertions/s.

  1) Failure:
ParsersYardTest#test_parses_threaded [/Users/nick/git/docs_doctor/test/parsers/yard_test.rb:13]:
Expected: 29
  Actual: 27

4 runs, 7 assertions, 1 failures, 0 errors, 0 skips

So I don't actually get a difference in the fixtures.

My first commit made the test fail because the doc_methods fixtures belonged to a repo that the user was already subscribed to. Thus, calling User.queue.subscribe_docs(user.id) didn't change the user's doc_assignments. It was 2, and it remained 2 after calling that method. My most recent change (to fix this test) was assigning them to a repo the user wasn't already subscribed to, so that calling User.queue.subscribe_docs(user.id) had the intended effect of changing the user's doc_assignments by 1, from 0 to 1.