Sha256: c1e70537104f3c8368bb5d89bf4133a6f8e2eab92a8b6f93af73468f36b5dba1

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

require 'observed/application/oneshot'

describe Observed::Application::Oneshot do
  let(:bar) {
    Class.new(Observed::Observer) do
      def observe
        sleep rand
        'Bar'
      end

      plugin_name 'oneshot_spec_bar'
    end
  }
  before {
    bar
  }
  #context 'with Hash objects' do
  #  subject {
  #    Observed::Application::Oneshot.create(:config => config)
  #  }
  #  let(:config) {
  #    {
  #        'observers' => {
  #          'test' => {
  #              plugin: 'oneshot_spec_bar',
  #              method: 'get',
  #              url: 'http://localhost:3000'
  #          }
  #        },
  #        'reporters' => {
  #          'test.*' => {
  #              plugin: 'stdout'
  #          }
  #        }
  #    }
  #  }
  #  it 'initializes' do
  #    expect(subject.run.size).not_to eq(0)
  #  end
  #end
  context 'with configuration files' do
    context 'with the correct plugins directory' do
      subject {
        Observed::Application::Oneshot.create(
            config_file: 'spec/fixtures/configure_by_conf/observed.conf'
        )
      }
      it 'initializes' do
        expect(subject.run.size).not_to eq(0)
      end
    end
  end
  context 'with configuration directories' do

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
observed-0.1.1 spec/oneshot_spec.rb