aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-10-30 10:12:02 +0000
committerMark Longair <mhl@pobox.com>2013-10-30 10:12:02 +0000
commit95a92efe385ebe21b8f31424f2cef86ea9c9455d (patch)
treec7d2530cf615cedc70cb463a9bc0f1c0c4de6729 /spec/lib
parent5964dc79a0e6608529ccf610460d1928811e8ef0 (diff)
parent5aed12997b6d8950e20b1620fd643256ca56f818 (diff)
Merge branch 'switch-theme-script' into rails-3-develop
Conflicts: config/initializers/alaveteli.rb
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