import chai from 'chai';
import customMemes from '../lib/custom_memes';

chai.should();

describe('custom_memes', () => {
  describe('ayylmao', () => {
    it('should return the correct imgur url and local file', done => {
      let completed = 0;

      function sendMessage(channel, res) {
        channel.should.equal('test');
        res.should.equal('http://i.imgur.com/m7NaGVx.png');

        completed++;
        if (completed === 2) return done();
      }

      function sendFile(channel, res) {
        channel.should.equal('test');
        res.should.equal('./images/Ayylmao.png');

        completed++;
        if (completed === 2) return done();
      }
      customMemes.ayylmao({
        sendMessage,
        sendFile
      }, {channel: 'test'});
    });
  });

  describe('chillenmyb', () => {
    it('should return the correct local file', done => {
      function sendFile(channel, res) {
        channel.should.equal('test');
        res.should.equal('./images/Chillenmyb.jpg');
        done();
      }
      customMemes.chillenmyb({sendFile}, {channel: 'test'});
    });
  });

  describe('feelsgoodman', () => {
    it('should return the correct local file', done => {
      function sendFile(channel, res) {
        channel.should.equal('test');
        res.should.equal('./images/Feelsgoodman.png');
        done();
      }
      customMemes.feelsgoodman({sendFile}, {channel: 'test'});
    });
  });

  describe('kappa', () => {
    it('should return the correct local file', done => {
      function sendFile(channel, res) {
        channel.should.equal('test');
        res.should.equal('./images/Kappa.png');
        done();
      }
      customMemes.kappa({sendFile}, {channel: 'test'});
    });
  });

  describe('kappahd', () => {
    it('should return the correct local file', done => {
      function sendFile(channel, res) {
        channel.should.equal('test');
        res.should.equal('./images/Kappahd.png');
        done();
      }
      customMemes.kappahd({sendFile}, {channel: 'test'});
    });
  });

  describe('skeltal', () => {
    it('should return the correct imgur url', done => {
      function sendMessage(channel, res) {
        channel.should.equal('test');
        res.should.equal('http://i.imgur.com/ZX79Q4S.png');
        done();
      }
      customMemes.skeltal({sendMessage}, {channel: 'test'});
    });
  });

  describe('starwars4', () => {
    it('should return the correct imgur url', done => {
      function sendMessage(channel, res) {
        channel.should.equal('test');
        res.should.equal('http://i.imgur.com/l9VKWWF.png');
        done();
      }
      customMemes.starwars4({sendMessage}, {channel: 'test'});
    });
  });

  describe('starwars5', () => {
    it('should return the correct imgur url', done => {
      function sendMessage(channel, res) {
        channel.should.equal('test');
        res.should.equal('http://i.imgur.com/eCpwo6J.png');
        done();
      }
      customMemes.starwars5({sendMessage}, {channel: 'test'});
    });
  });
});

@@ -18,16 +18,42 @@
 'chai';%0A
+import path from 'path';%0A%0A
 import c
@@ -91,16 +91,16 @@
 memes';%0A
-
 %0Achai.sh
@@ -579,33 +579,55 @@
 es.should.equal(
-'
+path.join(__dirname, '.
 ./images/Ayylmao
@@ -628,24 +628,25 @@
 yylmao.png')
+)
 ;%0A%0A        c
@@ -1004,33 +1004,55 @@
 es.should.equal(
-'
+path.join(__dirname, '.
 ./images/Chillen
@@ -1060,16 +1060,17 @@
 yb.jpg')
+)
 ;%0A      
@@ -1350,33 +1350,55 @@
 es.should.equal(
-'
+path.join(__dirname, '.
 ./images/Feelsgo
@@ -1404,24 +1404,25 @@
 oodman.png')
+)
 ;%0A        do
@@ -1693,33 +1693,55 @@
 es.should.equal(
-'
+path.join(__dirname, '.
 ./images/Kappa.p
@@ -1740,24 +1740,25 @@
 /Kappa.png')
+)
 ;%0A        do
@@ -2032,17 +2032,39 @@
 d.equal(
-'
+path.join(__dirname, '.
 ./images
@@ -2073,24 +2073,25 @@
 appahd.png')
+)
 ;%0A        do

update tests