aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/theme_spec.rb
blob: 829c1a269f7bb192e3592111269836653a0a34bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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