-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from solenko/master
Fix incorrect scope of Vcard.configure and Vcard.configuration methods
- Loading branch information
Showing
3 changed files
with
37 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require "test_helper" | ||
|
||
class ConfigurationTest < Test::Unit::TestCase | ||
def test_should_be_an_instance_of_configuration | ||
assert Vcard.configuration.is_a?(::Vcard::Configuration) | ||
end | ||
|
||
def test_have_default_values | ||
Vcard.configuration.reset | ||
assert_equal(Vcard.configuration.raise_on_invalid_line, true) | ||
assert_equal(Vcard.configuration.ignore_invalid_vcards, true) | ||
end | ||
|
||
def test_allow_configuration_with_block | ||
Vcard.configuration.reset | ||
Vcard.configure do |config| | ||
config.raise_on_invalid_line = false | ||
config.ignore_invalid_vcards = false | ||
end | ||
assert_equal(Vcard.configuration.raise_on_invalid_line, false) | ||
assert_equal(Vcard.configuration.ignore_invalid_vcards, false) | ||
end | ||
end |