Sha256: abb87e628e13e5dd4c18df65a07b751e25440fe24eed712181da1c3b65c36357

Contents?: true

Size: 1.85 KB

Versions: 57

Compression:

Stored size: 1.85 KB

Contents

require File.expand_path("../../helpers", __FILE__)

describe "App#apps" do
  it "lists app names" do
    with_random_apps do |apps|
      running(:apps) do
        does("Getting applications in #{client.current_space.name}")

        apps.sort_by(&:name).each do |a|
          outputs(a.name)
        end
      end
    end
  end

  it "filters by name with --name" do
    with_random_apps do |apps|
      name = sample(apps).name

      running(:apps, :name => name) do
        does("Getting applications in #{client.current_space.name}")

        apps.sort_by(&:name).each do |a|
          if a.name == name
            outputs(a.name)
          end
        end
      end
    end
  end

  it "filters by runtime with --runtime" do
    with_random_apps do |apps|
      runtime = sample(apps).runtime

      running(:apps, :runtime => runtime.name) do
        does("Getting applications in #{client.current_space.name}")

        apps.sort_by(&:name).each do |a|
          if a.runtime =~ /#{runtime}/
            outputs(a.name)
          end
        end
      end
    end
  end

  it "filters by framework with --framework" do
    with_random_apps do |apps|
      framework = sample(apps).framework

      running(:apps, :framework => framework.name) do
        does("Getting applications in #{client.current_space.name}")

        apps.sort_by(&:name).each do |a|
          if a.framework == framework
            outputs(a.name)
          end
        end
      end
    end
  end

  it "can be told which space with --space" do
    with_new_space do |space|
      with_random_apps do |other_apps|
        with_random_apps(space) do |apps|
          running(:apps, :space => space) do
            does("Getting applications in #{space.name}")

            apps.sort_by(&:name).each do |a|
              outputs(a.name)
            end
          end
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
vmc-0.4.0.beta.93 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.92 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.91 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.90 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.89 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.88 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.87 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.86 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.85 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.84 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.83 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.82 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.81 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.80 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.79 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.78 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.77 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.76 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.75 vmc-ng/spec/app/apps_spec.rb
vmc-0.4.0.beta.74 vmc-ng/spec/app/apps_spec.rb