       new Trix.Piece("text", { italic: true }),
       new Trix.Piece("!")
     ]
+
+
+test "textForAttachmentWithAttributes", ->
+  attachment = id: 1
+
+  text = Trix.Text.textForAttachmentWithAttributes(attachment)
+  runsEqual text,
+    [{ attachment: attachment, string: undefined, attributes: {} }],
+    "single-run text with attachment and no attributes"
+
+  text = Trix.Text.textForAttachmentWithAttributes(attachment, bold: true)
+  runsEqual text,
+    [{ attachment: attachment, string: undefined, attributes: { bold: true }}],
+    "single-run text with attachment and attributes"
+
+
+test "textForStringWithAttributes", ->
+  string = "Hello, world"
+
+  text = Trix.Text.textForStringWithAttributes(string)
+  runsEqual text,
+    [{ string: string, attachment: undefined, attributes: {} }],
+    "single-run text with string and no attributes"
+
+  text = Trix.Text.textForStringWithAttributes(string, italic: true)
+  runsEqual text,
+    [{ string: string, attachment: undefined, attributes: { italic: true }}],
+    "single-run text with string and attributes"
+
 
 test "#isEqualTo", ->
   ok @text.isEqualTo(@text), "text is equal to itself"


  equal @text.getLength(), 17, "multiple-run text length"


  text = @text.getTextAtRange([0, 16])
  ok !@text.isEqualTo(text) and !text.isEqualTo(@text), "text is not equal to subslice of text"


test "#getLength", ->
  text = new Trix.Text
  equal text.getLength(), 0, "empty text length is 0"
