Sha256: 50b63ab3e0557e7cfee87c215dd1baec5fe4bd28eed0f04389db7c439679b06b

Contents?: true

Size: 733 Bytes

Versions: 20

Compression:

Stored size: 733 Bytes

Contents

require 'spec_helper'

describe Maid do
  it 'should include Maid::NumericExtensions::Time' do
    1.minute.should == 60
  end
  it 'should include Maid::NumericExtensions::SizeToKb' do
    1.megabyte.should == 1024
  end
end

describe Maid, '.with_instance' do
  it 'should temporarily set the instance to the given argument and execute the block' do
    instance = mock('instance')
    Maid.with_instance(instance) { 0 }.should == 0
    Maid.instance_eval { @instance }.should be_nil
  end
end

describe Maid, '.rules' do
  it 'should run in the context of the Maid::Maid instance' do
    instance = mock('instance')
    instance.should_receive(:foo)

    Maid.with_instance(instance) do
      Maid.rules { foo }
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
maid-0.4.0.alpha.2 spec/lib/maid_spec.rb
maid-0.4.0.alpha.1 spec/lib/maid_spec.rb
maid-0.3.0 spec/lib/maid_spec.rb
maid-0.3.0.beta.1 spec/lib/maid_spec.rb
maid-0.2.3.alpha.1 spec/lib/maid_spec.rb
maid-0.2.2 spec/lib/maid_spec.rb
maid-0.2.2.beta.1 spec/lib/maid_spec.rb
maid-0.2.1 spec/lib/maid_spec.rb
maid-0.2.0 spec/lib/maid_spec.rb
maid-0.2.0.rc.2 spec/lib/maid_spec.rb
maid-0.2.0.rc.1 spec/lib/maid_spec.rb
maid-0.2.0.beta.3 spec/lib/maid_spec.rb
maid-0.2.0.beta.2 spec/lib/maid_spec.rb
maid-0.2.0.beta.1 spec/lib/maid_spec.rb
maid-0.2.0.alpha.1 spec/lib/maid_spec.rb
maid-0.1.4.alpha.2 spec/lib/maid_spec.rb
maid-0.1.4.alpha.1 spec/lib/maid_spec.rb
maid-0.1.3 spec/lib/maid_spec.rb
maid-0.1.3.beta.2 spec/lib/maid_spec.rb
maid-0.1.3.beta.1 spec/lib/maid_spec.rb