Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

fix overwriting of namespaced model test annotations with non-namespaced model annotations #166

merged 2 commits into from Feb 24, 2014


None yet
2 participants

jonoterc commented Feb 21, 2014

the test-file specific find_test_file method was matching namespaced model files when annotating non-namespaced models; using the same file resolution method for all file types fixes this.

e.g: with a User and a Foo::User model, User annotations were applied to both test/unit/user_test.rb as well as test/unit/foo/user_test.rb (order of operation was a factor here - if the non-namespaced model was annotated first this effect was not seen, as the namespaced annotations would overwrite and hide the issue)

Also, switched "mock" for "double" to kill deprecation warnings in specs

jonoterc added some commits Feb 21, 2014

@jonoterc jonoterc use general file resolution for test files as well
the special-purpose file resolution method for test/spec files was failing
with namespaced test files (ex. User model attributes would annotate both
test/unit/user_test.rb as well as test/unit/foo/user_test.rb, instead of
only the former)
@jonoterc jonoterc switch deprecated "mock" for "double" in annotate specs
changing to get rid of deprecation warnings

ctran commented Feb 22, 2014

Thanks for the patch. I will try to merge it in this weekend.

@ctran ctran added a commit that referenced this pull request Feb 24, 2014

@ctran ctran Merge pull request #166 from jonoterc/namespacefix
fix overwriting of namespaced model test annotations with non-namespaced model annotations

@ctran ctran merged commit 7cbdba6 into ctran:develop Feb 24, 2014

1 check failed

default The Travis CI build failed

jonoterc commented Feb 24, 2014


@ctran ctran added the bug label Feb 26, 2014

@ctran ctran added this to the 2.6.2 milestone Feb 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment