diff options
| author | mo khan <mo@mokhan.ca> | 2015-04-08 15:54:38 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-04-08 15:54:38 -0600 |
| commit | 21bdd0a70c641745e95f508b429e591bda8297ed (patch) | |
| tree | 68c1be0e34f3713413a7499595bb6718a27ecb7b /spec/node_spec.rb | |
| parent | c7363e63f3d6d60debe3721cecf3354d1904405d (diff) | |
convert snake case attributes to hyphen case.
Diffstat (limited to 'spec/node_spec.rb')
| -rw-r--r-- | spec/node_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 12c69c7..c277dd6 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -3,6 +3,7 @@ describe Scale::Node do include Scale::Node attribute :x, Integer attribute :y, Integer + attribute :fill_opacity, Float def xml_tag :fake @@ -42,5 +43,14 @@ describe Scale::Node do XML expect(subject.to_xml).to eql(expected) end + + it 'replaces underscores in attribute names' do + subject.fill_opacity = 0.5 + expected = <<-XML +<?xml version="1.0"?> +<fake fill-opacity="0.5"/> + XML + expect(subject.to_xml).to eql(expected) + end end end |
