aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/theme_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-10-30 15:27:18 +0000
committerLouise Crow <louise.crow@gmail.com>2013-10-30 15:27:18 +0000
commit24df604c39a3a9bef1345845796f1b628520dcd0 (patch)
tree0f14360b1b7b9dd3591c844a3b0ebc98076c9393 /spec/lib/theme_spec.rb
parent27f305b1fdaa450323719c5d78765ca99d1142e1 (diff)
parent95a92efe385ebe21b8f31424f2cef86ea9c9455d (diff)
Merge remote-tracking branch 'origin/rails-3-develop' into rails-3-develop
Diffstat (limited to 'spec/lib/theme_spec.rb')
-rw-r--r--spec/lib/theme_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/theme_spec.rb b/spec/lib/theme_spec.rb
new file mode 100644
index 000000000..829c1a269
--- /dev/null
+++ b/spec/lib/theme_spec.rb
@@ -0,0 +1,25 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe "theme_url_to_theme_name" do
+
+ it "should deal with a typical bare repo URL" do
+ url = 'git://wherever/blah-theme.git'
+ theme_url_to_theme_name(url).should == 'blah-theme'
+ end
+
+ it "should deal with a typical bare repo URL with trailing slashes" do
+ url = 'ssh://wherever/blah-theme.git//'
+ theme_url_to_theme_name(url).should == 'blah-theme'
+ end
+
+ it "should deal with a typical non-bare repo URL" do
+ url = '/home/whoever/themes/blah-theme'
+ theme_url_to_theme_name(url).should == 'blah-theme'
+ end
+
+ it "should deal with a typical non-bare repo URL with a trailing slash" do
+ url = '/home/whoever/themes/blah-theme/'
+ theme_url_to_theme_name(url).should == 'blah-theme'
+ end
+
+end