Sha256: 84259c5abf4bd49ee89030542a5e5f49ecf7a167747210ba7ea362da1adcb27b

Contents?: true

Size: 866 Bytes

Versions: 15

Compression:

Stored size: 866 Bytes

Contents

require 'spec_helper'

describe MB::Gear::JMX do
  subject { described_class }

  it "is registered with MB::Gear" do
    MB::Gear.all.should include(subject)
  end

  it "has the inferred keyword ':jmx' from it's Class name" do
    subject.keyword.should eql(:jmx)
  end

  describe "#action" do
    subject { MB::Gear::JMX.new }
    before { described_class.any_instance.stub(jruby?: true) }

    it "returns a Gear::JMX::Action" do
      expect(subject.action(9001, "com.some.thing:name=thing") { |bean| }).to be_a(MB::Gear::JMX::Action)
    end

    context "when not running under JRuby" do
      before { described_class.any_instance.stub(jruby?: false) }

      it "raises an ActionNotSupported error" do
        expect {
          subject.action(9001, "com.some.thing:name=thing")
        }.to raise_error(MB::ActionNotSupported)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
motherbrain-1.5.0 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.4.0 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.3.0 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.2.1 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.2.0 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.1.3 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.1.2 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.1.1 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.1.0 spec/unit/mb/gears/jmx_spec.rb
motherbrain-1.0.0 spec/unit/mb/gears/jmx_spec.rb
motherbrain-0.14.5 spec/unit/mb/gears/jmx_spec.rb
motherbrain-0.14.4 spec/unit/mb/gears/jmx_spec.rb
motherbrain-0.14.3 spec/unit/mb/gears/jmx_spec.rb
motherbrain-0.14.2 spec/unit/mb/gears/jmx_spec.rb
motherbrain-0.13.1 spec/unit/mb/gears/jmx_spec.rb