add rspec for cag.rb

1. add rspec for cag
2. fix log location issue.
3. add $pfx in spec_helper