slugity 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
- require 'slugity/utilities'
3
-
4
- describe Slugity::Util do
5
-
6
- describe "#trim_string" do
7
- it "removes begining and ending spaces" do
8
- Slugity::Util.trim_string( " hello world" ).should == "hello world"
9
- Slugity::Util.trim_string( "hello world " ).should == "hello world"
10
- Slugity::Util.trim_string( " hello world " ).should == "hello world"
11
- Slugity::Util.trim_string( " hello world " ).should == "hello world"
12
- end
13
- end
14
- end
@@ -1,39 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
4
- require 'slugity'
5
-
6
- test_strings = {
7
- "Hello World" => "hello-world",
8
- "one Flew_South" => "one-flew_south",
9
- "Attr: Halp" => "attr-halp",
10
- "Freddie & Bananas" => "freddie-and-bananas",
11
- "One + Two = Three" => "one-plus-two-equals-three",
12
- " hello world" => "hello-world",
13
- "hello world " => "hello-world",
14
- "post id 1234" => "post-id-1234",
15
- "124 post id" => "124-post-id"
16
- }
17
-
18
- describe Slugity do
19
-
20
- include Slugity
21
-
22
- describe "#slugity()" do
23
- it "returns a properly formatted string" do
24
- test_strings.each do |input,output|
25
- slugity( input ).should == output
26
- end
27
- end
28
-
29
- it "handles non-strings like numbers" do
30
- slugity( 42 ).should == "42"
31
- slugity( 123.456 ).should == "123456"
32
- end
33
-
34
- it "strips unrecognized characters" do
35
- slugity( "a…‡†i".encode("UTF-8") ).should == "ai"
36
- end
37
- end
38
-
39
- end