Sha256: aa124d8c8c8deef04b00515d372da1ff1b0bf34f39a864e1df2508075ce6cb4b

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

require 'spec_helper'
require 'ronin/author'

describe Author do
  it "should have a String representation" do
    author = Author.new(:name => 'test')
    author.to_s.should == 'test'
  end

  describe "to_s" do
    it "should return the name when their is no email" do
      author = Author.new(:name => 'anonymous')

      author.to_s.should == 'anonymous'
    end

    it "should return the name and email when both are present" do
      author = Author.new(
        :name => 'anonymous',
        :email => 'anonymous@example.com'
      )

      author.to_s.should == 'anonymous <anonymous@example.com>'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ronin-1.0.0.pre3 spec/author_spec.rb
ronin-1.0.0.pre2 spec/author_spec.rb
ronin-1.0.0.pre1 spec/author_spec.rb