spec/extensions/string_spec.rb in ronin-support-0.1.0.pre2 vs spec/extensions/string_spec.rb in ronin-support-0.1.0.pre3
- old
+ new
@@ -1,10 +1,10 @@
require 'spec_helper'
require 'ronin/extensions/string'
describe String do
- describe "each_substring" do
+ describe "#each_substring" do
subject { 'hello' }
it "should enumerate over each sub-string within the String" do
subject.each_substring do |sub_string|
should include(sub_string)
@@ -34,11 +34,11 @@
subject.include?(sub_string)
}.should == true
end
end
- describe "each_unique_substring" do
+ describe "#each_unique_substring" do
subject { 'abablol' }
it "should enumerate over each unique sub-string within the String" do
seen = []
@@ -73,11 +73,11 @@
seen = seen.to_a
seen.uniq.should == seen
end
end
- describe "common_prefix" do
+ describe "#common_prefix" do
it "should find the common prefix between two Strings" do
one = 'What is puzzling you is the nature of my game'
two = 'What is puzzling you is the nature of my name'
common = 'What is puzzling you is the nature of my '
@@ -105,11 +105,11 @@
one.common_prefix(two).should == ''
end
end
- describe "common_postfix" do
+ describe "#common_postfix" do
it "should find the common postfix between two Strings" do
one = 'Tell me baby whats my name'
two = "Can't you guess my name"
common = 's my name'
@@ -129,11 +129,11 @@
one.common_postfix(two).should == ''
end
end
- describe "uncommon_substring" do
+ describe "#uncommon_substring" do
it "should find the uncommon substring between two Strings" do
one = "Tell me baby whats my name"
two = "Tell me honey whats my name"
uncommon = 'bab'
@@ -155,10 +155,10 @@
one.uncommon_substring(two).should == uncommon
end
end
- describe "dump" do
+ describe "#dump" do
it "should dump printable strings" do
"hello".dump.should == '"hello"'
end
it "should dump strings containing control characters" do