spec/arachni/issue_spec.rb in arachni-0.4.5.2 vs spec/arachni/issue_spec.rb in arachni-0.4.6
- old
+ new
@@ -17,11 +17,14 @@
cvssv2: '4.5',
remedy_guidance: 'How to fix the issue.',
remedy_code: 'Sample code on how to fix the issue',
verification: false,
metasploitable: 'exploit/unix/webapp/php_include',
- opts: { 'some' => 'opts' },
+ opts: {
+ 'some' => 'opts',
+ 'blah' => "\xE2\x9C\x93"
+ },
mod_name: 'Module name',
internal_modname: 'module_name',
tags: %w(these are a few tags),
var: 'input name',
url: 'http://test.com/stuff/test.blah?query=blah',
@@ -70,16 +73,20 @@
it 'is assigned to Arachni::Severity for easy access' do
Arachni::Severity.should == Arachni::Issue::Severity
end
end
+ it 'recodes string data to UTF8' do
+ @issue.opts['blah'].should == "\u2713"
+ end
+
it 'assigns the values in opts to the the instance vars' do
@issue_data.each do |k, v|
next if [ :opts, :regexp ].include?( k )
@issue.instance_variable_get( "@#{k}".to_sym ).should == @issue_data[k]
end
- @issue.opts.should == { regexp: '' }.merge( @issue_data[:opts] )
+ @issue.opts.should == { regexp: '' }.merge( @issue_data[:opts] ).recode
@issue.cwe_url.should == 'http://cwe.mitre.org/data/definitions/1.html'
end
describe '#tags' do
it 'returns the set tags' do
@@ -123,10 +130,10 @@
issue = Arachni::Issue.new( issue: @issue_data )
@issue_data.each do |k, v|
next if [ :opts, :regexp, :mod_name ].include?( k )
issue.instance_variable_get( "@#{k}".to_sym ).should == @issue_data[k]
end
- issue.opts.should == { regexp: '' }.merge( @issue_data[:opts] )
+ issue.opts.should == { regexp: '' }.merge( @issue_data[:opts] ).recode
issue.cwe_url.should == 'http://cwe.mitre.org/data/definitions/1.html'
end
end
describe '#url=' do