adding rspec tests and fixing Bag.add_to_env