This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix OWMW space replacement issue, closes #48
- Loading branch information
nemesisdesign
committed
Jun 23, 2014
1 parent
7ae0b03
commit 74cb0e4
Showing
4 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,42 @@ | ||
require 'test_helper' | ||
|
||
class ConfigurationTest < ActiveSupport::TestCase | ||
# Replace this with your real tests. | ||
test "the truth" do | ||
assert true | ||
test "get" do | ||
c = Configuration.get('wisps_with_owmw') | ||
assert_equal Array, c.class | ||
assert_equal 0, c.length | ||
end | ||
|
||
test "set" do | ||
Configuration.set('wisps_with_owmw', 'test1', 'array') | ||
c = Configuration.get('wisps_with_owmw') | ||
assert_equal Array, c.class | ||
assert_equal 1, c.length | ||
assert_equal 'test1', c[0] | ||
|
||
Configuration.set('wisps_with_owmw', 'test1, test2', 'array') | ||
c = Configuration.get('wisps_with_owmw') | ||
assert_equal Array, c.class | ||
assert_equal 2, c.length | ||
assert_equal 'test1', c[0] | ||
assert_equal 'test2', c[1] | ||
|
||
Configuration.set('wisps_with_owmw', 'one,two,three', 'array') | ||
c = Configuration.get('wisps_with_owmw') | ||
assert_equal Array, c.class | ||
assert_equal 3, c.length | ||
assert_equal 'one', c[0] | ||
assert_equal 'two', c[1] | ||
assert_equal 'three', c[2] | ||
end | ||
|
||
test "slugify" do | ||
Configuration.set('wisps_with_owmw', 'Test Slug, Another One,Do It', 'array') | ||
c = Configuration.get('wisps_with_owmw') | ||
assert_equal c.class, Array | ||
assert_equal c.length, 3 | ||
assert_equal 'test-slug', c[0] | ||
assert_equal 'another-one', c[1] | ||
assert_equal 'do-it', c[2] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters