Sha256: ed59b3707fc030c6fc76e57dea84037871998023234ecf6647b6975641d18a72

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

require 'spec_helper'

describe Lita::Handlers::Eval, lita_handler: true do
  it 'evaluates the code' do
    stub_request(:post, 'http://eval.so/api/evaluate')
      .with(body: MultiJson.dump(language: 'ruby', code: 'p(2 + 2)'))
      .to_return(status: 200, body: MultiJson.dump(stdout: "4\n"))
    send_command('eval 2 + 2')
    expect(replies.last).to eq('4')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lita-eval-0.1.0 spec/lita/handlers/eval_spec.rb
lita-eval-0.0.3 spec/lita/handlers/eval_spec.rb