This appears to be specific to our rspec tests.  The following code works as expected:

```puppet
$test = 1

notify  { "fact: ${::processorcount}": }
notify { "var: ${test}": }

validate_re($::processorcount, '^\d+$', 'fact not digit')
validate_re($test, '^\d+$', 'fact not digit')
```