Sha256: 38fbae5cc07b9be790328c3ffabe963504d76ff075357a054e0e5d05ca63311b

Contents?: true

Size: 956 Bytes

Versions: 4

Compression:

Stored size: 956 Bytes

Contents

require File.dirname(__FILE__) + "/../helpers/acceptance"
require "helpers/acceptance/email_notifier"
require "helpers/acceptance/textfile_notifier"

require "integrity/notifier/test"

class NotifierTestTest < Test::Unit::TestCase
  include Integrity::Notifier::Test

  setup do
    @notifier = Integrity::Notifier::Textfile
    @config   = {"file" => "/tmp/integrity.txt"}

    FileUtils.rm @config["file"] if File.exists?(@config["file"])
  end

  def notifier
    "Textfile"
  end

  test "it provides a formulary to configure options" do
    assert provides_option?("file")
    assert provides_option?("file", @config["file"])
  end

  test "it sends notification" do
    build = build(:successful)

    @notifier.notify_of_build(build, @config)

    notification = File.read(@config["file"])

    assert notification.start_with?("===")
    assert notification.include?(build.commit.identifier)
    assert notification.include?("successful")
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
alphasights-integrity-0.1.10 test/acceptance/notifier_test_test.rb
integrity-integrity-0.1.10 test/acceptance/notifier_test_test.rb
integrity-0.1.11 test/acceptance/notifier_test_test.rb
integrity-0.1.10 test/acceptance/notifier_test_test.rb