Sha256: 035e57a1c4caaaf5da71c436841d3668d1d1c17a68b965991033fb27db2534d5

Contents?: true

Size: 627 Bytes

Versions: 18

Compression:

Stored size: 627 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

18 entries across 18 versions & 1 rubygems

Version Path
ronin-1.5.0 spec/author_spec.rb
ronin-1.5.0.rc2 spec/author_spec.rb
ronin-1.5.0.rc1 spec/author_spec.rb
ronin-1.4.1 spec/author_spec.rb
ronin-1.4.0 spec/author_spec.rb
ronin-1.4.0.rc2 spec/author_spec.rb
ronin-1.4.0.rc1 spec/author_spec.rb
ronin-1.3.0 spec/author_spec.rb
ronin-1.2.0 spec/author_spec.rb
ronin-1.1.0 spec/author_spec.rb
ronin-1.1.0.rc3 spec/author_spec.rb
ronin-1.1.0.rc2 spec/author_spec.rb
ronin-1.1.0.rc1 spec/author_spec.rb
ronin-1.0.0 spec/author_spec.rb
ronin-1.0.0.rc3 spec/author_spec.rb
ronin-1.0.0.rc2 spec/author_spec.rb
ronin-1.0.0.rc1 spec/author_spec.rb
ronin-1.0.0.pre4 spec/author_spec.rb