First commit for more generic enumerating and scanning

This commit is contained in:
Christian Mehlmauer
2012-09-15 20:30:06 +02:00
parent bf940b2065
commit 8bc9f47cc7
10 changed files with 370 additions and 192 deletions

View File

@@ -44,6 +44,11 @@ describe WpPlugin do
@expected_uri_string = "http://example.com/wp-content/plugins/example/"
end
it "should return the uri without the file" do
@url = "https://sub.example.com/path/to/dir/wp-content/plugins/example/readme.txt"
@expected_uri_string = "https://sub.example.com/path/to/dir/wp-content/plugins/example/"
end
it "should return the same uri" do
@url = "http://example.com/wp-content/plugins/hello-world/"
@expected_uri_string = @url
@@ -65,6 +70,10 @@ describe WpPlugin do
it "should return 'example-plugin'" do
WpPlugin.extract_name_from_location_url('http://example.com/wp-content/plugins/example-plugin/').should === 'example-plugin'
end
it "should return 'example-plugin'" do
WpPlugin.extract_name_from_location_url('https://sub.example.com/path/to/a/wp-content/plugins/example-plugin/').should === 'example-plugin'
end
end
describe "#create_location_url_from_name" do