I am trying to create a gem, but when trying to load a module in test I get the following error. I used "Configurable Ruby gems: Custom error messages and testing" to set environment variables from users and that's where most of the code is from.
1) Msg91sms::Configuration with configuration block returns the correct authkey
Failure/Error: raise Errors::Configuration, "Msg94 auth key missing!" unless @authkey
NameError:
uninitialized constant Msg91sms::Configuration::Errors
# ./lib/msg91sms/configuration.rb:10:in `authkey'
# ./spec/msg91sms/configuration_spec.rb:7:in `block (3 levels) in <top (required)>'
but as per the folder structure and everything this should be Msg91sms::Errors::Configuration. I put only one here even though all tests are failing due to improper module loading.
The gem with this error can be found here: https://github.com/flyingboy007/msg91sms/tree/development
bundle exec rspec will throw all errors.
It should be something with naming or improper loading. But I can't figure out.
After following the answer by @sergio, I am now getting this error:
1) Msg91sms::Configuration with configuration block returns the correct authkey
Failure/Error: raise ::Msg91sms::Errors::Configuration, "Msg91 auth key missing!" unless @authkey
NameError:
uninitialized constant Msg91sms::Errors
# ./lib/msg91sms/configuration.rb:10:in `authkey'
# ./spec/msg91sms/configuration_spec.rb:7:in `block (3 levels) in <top (required)>'
Could someone tell me what am doing wrong here?
Errors::ConfigurationorConfiguration::Errors?module Msg94sms module Errors class Configuration < StandardError; end end end