aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib')
-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