Sha256: 2447ee70c4b208512a7c886627f802d2a64f9e0319edeeaf95bbccff637d8252

Contents?: true

Size: 1.34 KB

Versions: 9

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe Elasticrawl::Cluster do
  describe '#create_job_flow' do
    let(:crawl) { Elasticrawl::Crawl.create(:crawl_name => 'CC-MAIN-2014-49') }
    let(:job) { Elasticrawl::ParseJob.new }
    let(:cluster) { Elasticrawl::Cluster.new }
    subject { cluster.create_job_flow(job) }

    before do
      job.set_segments(crawl.crawl_segments)
    end

    it 'should be an Elasticity::JobFlow' do
      expect(subject).to be_a Elasticity::JobFlow
    end

    it 'should have a job flow name' do
      expect(subject.name).to eq "Job: #{job.job_name} #{job.job_desc}"
    end

    it 'should have a log uri' do
      expect(subject.log_uri).to eq job.log_uri
    end

    it 'should have an ec2 key name' do
      expect(subject.ec2_key_name).to eq 'elasticrawl'
    end

    it 'should have a placement az name' do
      expect(subject.placement).to eq 'us-east-1c'
    end

    it 'should have an ami version' do
      expect(subject.ami_version).to eq 'latest'
    end
  end

  describe '#cluster_desc' do
    let(:cluster_desc) {
      cluster_desc = <<-HERE
Cluster configuration
Master: 1 m1.medium  (Spot: 0.12)
Core:   2 m1.medium  (Spot: 0.12)
Task:   --
      HERE
    }
    subject { Elasticrawl::Cluster.new } 

    it 'should describe configured instance groups' do
      expect(subject.cluster_desc).to eq cluster_desc
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
elasticrawl-1.1.8 spec/unit/cluster_spec.rb
elasticrawl-1.1.7 spec/unit/cluster_spec.rb
elasticrawl-1.1.6 spec/unit/cluster_spec.rb
elasticrawl-1.1.5 spec/unit/cluster_spec.rb
elasticrawl-1.1.4 spec/unit/cluster_spec.rb
elasticrawl-1.1.3 spec/unit/cluster_spec.rb
elasticrawl-1.1.2 spec/unit/cluster_spec.rb
elasticrawl-1.1.1 spec/unit/cluster_spec.rb
elasticrawl-1.1.0 spec/unit/cluster_spec.rb