TrimAgency / htcht

The internal development CLI for Trim Agency
MIT License
3 stars 1 forks source link

Cannot alter Thor options after set by user ( test only ) #39

Closed apmiller108 closed 6 years ago

apmiller108 commented 7 years ago

An attempt to set Thor options to a default results in the below error since these options are apparently frozen.

Failure/Error: options[:rails_version] ||= latest_rails

     RuntimeError:
       can't modify frozen Thor::CoreExt::HashWithIndifferentAccess
     # ./vendor/bundle/gems/thor-0.19.4/lib/thor/core_ext/hash_with_indifferent_access.rb:24:in `[]='
     # ./vendor/bundle/gems/thor-0.19.4/lib/thor/core_ext/hash_with_indifferent_access.rb:24:in `[]='
     # ./lib/htcht/cli/rails/rails.rb:34:in `new'
stevetwitte commented 7 years ago

This is an issue with the rspec test as far as I can tell. The rspec test needs to be updated but I am not sure how? this may be of some help: https://bokstuff.com/testing-thor-command-lines-with-rspec/