set_const
set_const is a (dangerous) gem that let you modify a constant’s value
without any warning. It’s useful for testing purposes, for example when your
code rely on a constant like ARGV
or RUBY_PLATFORM
.
Install
gem install set_const
Usage
require 'set_const'
set_const('ARGV', %w[--foo bar])
set_const('RUBY_PLATFORM', 'Foobar')
Tests
$ git clone https://github.com/bfontaine/set_const.git
$ cd set_const
$ bundle install
$ bundle exec rake test