Project

set_const

0.0
No commit activity in last 3 years
No release in over 3 years
Change a constant's value without any warning
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7
~> 10.3
~> 0.8
~> 2.5

Runtime

~> 0.1
 Project Readme

set_const

Build Status Gem Version Coverage Status Inline docs

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