Sha256: 62554cf870ec2dfe4dc6587fe3c8135f6da99d03683c716e3d91ce948c031108

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

# encoding: UTF-8

require_relative '../spec_helper'

module Signore describe Signature do

  before do
    Database.load 'spec/fixtures/signatures.yml'
  end

  describe '#display' do

    it 'returns a signature formatted with meta information (if available)' do
      Database.db[2].display.must_equal '// sometimes I believe compiler ignores all my comments'
      Database.db[4].display.must_equal "stay-at-home executives vs. wallstreet dads\n                                     [kodz]"
      Database.db[1].display.must_equal "You do have to be mad to work here, but it doesn’t help.\n                                      [Gary Barnes, asr]"
      Database.db[3].display.must_equal "Bruce Schneier knows Alice and Bob’s shared secret.\n                             [Bruce Schneier Facts]"
      Database.db[0].display.must_equal "She was good at playing abstract confusion in\nthe same way a midget is good at being short.\n              [Clive James on Marilyn Monroe]"
      Database.db[5].display.must_equal "Amateur fighter pilot ignores orders, listens to\nthe voices in his head and slaughters thousands.\n                    [Star Wars ending explained]"
    end

  end

  describe '#tagged_with?' do

    it 'says whether a tagged signatura is tagged with a given tag' do
      refute Database.db[2].tagged_with? 'fnord'
      assert Database.db[2].tagged_with? 'programming'
      assert Database.db[2].tagged_with? 'tech'
    end

    it 'says that an untagged signature is not tagged with any tag' do
      refute Database.db[4].tagged_with? 'fnord'
    end

  end

end end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signore-0.0.0 spec/signore/signature_spec.rb