#-- # WPScan - WordPress Security Scanner # Copyright (C) 2012 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #++ require File.expand_path(File.dirname(__FILE__) + '../../../lib/wpscan/wpscan_helper') describe "common_helper" do describe "#get_equal_string" do after :each do output = get_equal_string_end(@input) output.should == @expected end it "sould return an empty string" do @input = [""] @expected = "" end it "sould return an empty string" do @input = [] @expected = "" end it "sould return asdf" do @input = ["kjh asdf", "oijr asdf"] @expected = " asdf" end it "sould return « BlogName" do @input = ["user1 « BlogName", "user2 « BlogName", "user3 « BlogName", "user4 « BlogName"] @expected = " « BlogName" end it "sould return an empty string" do @input = %w{user1 user2 user3 user4} @expected = "" end it "sould return an empty string" do @input = ["user1 « BlogName", "user2 « BlogName", "user3 « BlogName", "user4 « BlogNamea"] @expected = "" end it "sould return an empty string" do @input = %w{ user1 } @expected = "" end end end