How come not just:
```ruby
Object.const_set(:Rails, double('Rails'))
```

BTW, mock is going to be deprecated, so we should start using double for mock and stub