Sha256: 5e3edd2890b509d994053320d444b90c6fcd3099a2ba44448f7b3afb54bf1e0a

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

require 'spec_helper'
require 'miu/dsl'

describe Miu do
  describe 'dump_cli_options' do
    let(:options) { {'--string' => 'string', '--array' => ['foo', 'bar buzz']} }
    let(:str) { Miu.dump_cli_options(options) }
    it { expect(str).to eq "--string=string --array='foo' 'bar buzz'" }
  end

  describe 'watch' do
    let(:watch) do
      Class.new do
        attr_accessor :dir, :log, :name, :group
        attr_accessor :start, :stop, :restart
      end.new
    end

    before do
      God.stub(:watch).and_yield(watch)
      Miu.watch 'test' do |w|
        expect(w).to eq watch
        w.start = 'foo'
        w.stop = 'bar', {:buzz => 123}
      end
    end

    it { expect(watch.start).to be_instance_of String }
    it { expect(watch.stop).to be_instance_of String }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
miu-0.2.3 spec/miu/dsl_spec.rb
miu-0.2.2 spec/miu/dsl_spec.rb
miu-0.2.1 spec/miu/dsl_spec.rb