add unit tests for NilClass
Merge pull request #1875 from akuroda/pr_nil_test

add unit tests for NilClass