Sha256: 3cc1344669e00fdb5b35ae57b53f1ac8c34c11933e9223e74e1816082ce7508e

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

require File.expand_path("../spec_helper", __FILE__)

module Danger
  describe Danger::DangerIstanbul do
    it "should be a plugin" do
      expect(Danger::DangerIstanbul.new(nil)).to be_a Danger::Plugin
    end

    #
    # You should test your custom attributes and methods here
    #
    describe "with Dangerfile" do
      before do
        @dangerfile = testing_dangerfile
        @my_plugin = @dangerfile.istanbul
      end

      # Some examples for writing tests
      # You should replace these with your own.

      it "Warns on a monday" do
        monday_date = Date.parse("2016-07-11")
        allow(Date).to receive(:today).and_return monday_date

        @my_plugin.warn_on_mondays

        expect(@dangerfile.status_report[:warnings]).to eq(["Trying to merge code on a Monday"])
      end

      it "Does nothing on a tuesday" do
        monday_date = Date.parse("2016-07-12")
        allow(Date).to receive(:today).and_return monday_date

        @my_plugin.warn_on_mondays

        expect(@dangerfile.status_report[:warnings]).to eq([])
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
danger-istanbul-0.0.4 spec/istanbul_spec.rb
danger-istanbul-0.0.3 spec/istanbul_spec.rb
danger-istanbul-0.0.2 spec/istanbul_spec.rb
danger-istanbul-0.0.1 spec/istanbul_spec.rb