Sha256: e7708154b6aa82004728f55a9c9c47a386b5e901b9591b57d94b69a9047a4ab7

Contents?: true

Size: 767 Bytes

Versions: 2

Compression:

Stored size: 767 Bytes

Contents

require "spec_helper"

describe Rocx::Parts::Document do
  include PartTestMacros

  context "with child elements" do
    before(:each) do
      @doc = described_class.new
      paragraph = Rocx::Elements::Paragraph.new

      first_run = Rocx::Elements::Run.new
      first_run << Rocx::Elements::Text.new("This is just a test run.")
      paragraph << first_run

      second_run = Rocx::Elements::Run.new
      second_run << Rocx::Elements::Text.new("But this isn't!")
      paragraph << second_run

      doc << paragraph
    end

    it_should_output_correct_xml part: "document_with_children"
  end

  context "with no elements" do
    before(:each) do
      @doc = described_class.new
    end

    it_should_output_correct_xml part: "empty_document"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rocx-0.6.0 spec/parts/document_spec.rb
rocx-0.5.8 spec/parts/document_spec.rb