From a382b78f8024d2050c7cfa6ebf2e7dad235eb93b Mon Sep 17 00:00:00 2001 From: Joe Vennix Date: Mon, 3 Mar 2014 21:54:09 -0600 Subject: [PATCH] Oops, $ and _ need to be in the spec. * Repeats the random check 20 times for each spec. --- spec/lib/rex/exploitation/jsobfu_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/lib/rex/exploitation/jsobfu_spec.rb b/spec/lib/rex/exploitation/jsobfu_spec.rb index e8eba7a7fc..c2b35631e6 100644 --- a/spec/lib/rex/exploitation/jsobfu_spec.rb +++ b/spec/lib/rex/exploitation/jsobfu_spec.rb @@ -13,12 +13,12 @@ describe Rex::Exploitation::JSObfu do it { should be_a String } it { should_not be_empty } - it 'is alphanumeric' do - expect(random_var_name).to match(/\A[a-zA-Z0-9]+\Z/) + it 'is composed of _, $, alphanumeric chars' do + 20.times { expect(jsobfu.random_var_name).to match(/\A[a-zA-Z0-9$_]+\Z/) } end it 'does not start with a number' do - expect(random_var_name).not_to match(/\A[0-9]/) + 20.times { expect(jsobfu.random_var_name).not_to match(/\A[0-9]/) } end context 'when a reserved word is generated' do