spec/javascript_runtime_spec.rb in cldr-plurals-runtime-js-1.0.0 vs spec/javascript_runtime_spec.rb in cldr-plurals-runtime-js-1.1.0
- old
+ new
@@ -202,6 +202,16 @@
it '#t returns visible fractional digits (without zeroes)' do
expect(rt.t(num)).to eq(23)
end
end
+
+ context 'with global variables already present' do
+ context = V8::Context.new
+ context.eval('v = 5')
+ context.eval(CldrPlurals::JavascriptRuntime.source)
+ it 'expects to not overwrite variables of the global scope' do
+ expect(context.eval('v')).to eq(5)
+ end
+ end
+
end