Sha256: 829026896482cff99670a4ec1568769063d17993749eca4455db551132032449

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

require File.expand_path('spec_helper', __dir__)

# Module tests
module Danger
  describe Danger::DangerTheCodingLove do
    it 'should be a plugin' do
      expect(Danger::DangerTheCodingLove.new(nil)).to be_a Danger::Plugin
    end

    describe 'with Dangerfile' do
      before do
        @dangerfile = testing_dangerfile
        @the_coding_love = @dangerfile.the_coding_love
      end

      it 'prints a random url' do
        rnd_url = @the_coding_love.random_post_url
        
        # expect(rnd_url).to eq('') # for development, should not be empty
        expect(rnd_url).not_to be_empty
      end

      it 'prints a random post' do
        post = @the_coding_love.random

        expect(post[0]).not_to be_empty
        expect(post[1]).not_to be_empty
        expect(@dangerfile.status_report[:markdowns]).not_to be_nil
      end

      it 'prints an image post' do
        post = @the_coding_love.at_url('https://thecodinglove.com/ai-in-cars-is-getting-better')

        expect(post[0]).not_to be_empty
        expect(post[1]).not_to be_empty
        expect(File.extname(post[1]).strip.downcase).to eq '.jpg'
        expect(@dangerfile.status_report[:markdowns]).not_to be_nil
      end

      it 'prints a gif post' do
        post = @the_coding_love.at_url('https://thecodinglove.com/when-i-commit-push-right-after-someone-has')

        expect(post[0]).not_to be_empty
        expect(post[1]).not_to be_empty
        expect(File.extname(post[1]).strip.downcase).to eq '.gif'
        expect(@dangerfile.status_report[:markdowns]).not_to be_nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-the_coding_love-0.0.7 spec/the_coding_love_spec.rb