diff options
Diffstat (limited to 'spec/circle_spec.rb')
| -rw-r--r-- | spec/circle_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/circle_spec.rb b/spec/circle_spec.rb new file mode 100644 index 0000000..27486b8 --- /dev/null +++ b/spec/circle_spec.rb @@ -0,0 +1,25 @@ + +describe Scale::Circle do + it { expect(subject.xml_tag).to eql(:circle) } + + describe "#attributes" do + it "includes the radius" do + subject.r = 10 + expect(subject.attributes).to include(r: 10) + end + + it "includes the x position of the center of the circle" do + subject.cx = 10 + expect(subject.attributes).to include(cx: 10) + end + + it "includes the y position of the center of the circle" do + subject.cy = 10 + expect(subject.attributes).to include(cy: 10) + end + + it "skips attributes that are not specified" do + expect(subject.attributes).to be_empty + end + end +end |
