Sha256: a374b7345127b6678e62988d63ef6ff2fff5048b54b3a8ade5c4afe60f872158

Contents?: true

Size: 1.16 KB

Versions: 31

Compression:

Stored size: 1.16 KB

Contents

require File.join(File.dirname(File.expand_path(__FILE__)), "/../spec_helper.rb")

describe "AutomateIt::PlatformManager" do
  before(:all) do
    @a = AutomateIt.new
    @m = @a.platform_manager
    @m.setup(:default => :struct, :struct => {
      :os => "mizrahi",
      :arch => "realian",
      :distro => "momo",
      :version => "s100",
    })
  end

  it "should query key by symbol" do
    @m.query(:os).should == "mizrahi"
  end

  it "should query key by string" do
    @m.query("distro").should == "momo"
  end

  it "should query by two-key query" do
    @m.query("os#arch").should == "mizrahi_realian"
    @m.query("distro#version").should == "momo_s100"
  end

  it "should query by three-part query" do
    @m.query("os#distro#version").should == "mizrahi_momo_s100"
    @m.query("distro#version#arch").should == "momo_s100_realian"
  end

  it "should query by aliases" do
    @m.query("release#version").should == "s100_s100"
  end

  it "should fail on invalid top-level keys" do
    lambda { @m.query(:asdf) }.should raise_error(IndexError)
  end

  it "should fail on invalid subkeys" do
    lambda { @m.query("os#asdf") }.should raise_error(IndexError)
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
automate-it-0.9.2 spec/unit/platform_manager_spec.rb
automate-it-0.9.1 spec/unit/platform_manager_spec.rb
automate-it-0.9.0 spec/unit/platform_manager_spec.rb
automateit-0.71003 spec/unit/platform_manager_spec.rb
automateit-0.70923 spec/unit/platform_manager_spec.rb
automateit-0.70928 spec/unit/platform_manager_spec.rb
automateit-0.70930 spec/unit/platform_manager_spec.rb
automateit-0.71006 spec/unit/platform_manager_spec.rb
automateit-0.71017 spec/unit/platform_manager_spec.rb
automateit-0.71021 spec/unit/platform_manager_spec.rb
automateit-0.71030 spec/unit/platform_manager_spec.rb
automateit-0.71012 spec/unit/platform_manager_spec.rb
automateit-0.71031.1 spec/unit/platform_manager_spec.rb
automateit-0.71031.2 spec/unit/platform_manager_spec.rb
automateit-0.71031 spec/unit/platform_manager_spec.rb
automateit-0.71101 spec/unit/platform_manager_spec.rb
automateit-0.71101.2 spec/unit/platform_manager_spec.rb
automateit-0.71102 spec/unit/platform_manager_spec.rb
automateit-0.71103 spec/unit/platform_manager_spec.rb
automateit-0.71101.1 spec/unit/platform_manager_spec.rb