Sha256: 0b2ad6c5906523114425c5872b785324178f7f9041e1094a7942e888598cfe45

Contents?: true

Size: 1.58 KB

Versions: 22

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'

describe SimplerWorkflow do
  let(:client) { AWS.config.simple_workflow_client }

  let(:describe_domain_response) { client.stub_for(:describe_domain) }
  let(:list_domains_response) { client.stub_for(:list_domains) }

  let(:domain) { SimplerWorkflow.domain("test-domain") }

  let(:domain_desc) {{
    'configuration' => { 'workflowExecutionRetentionPeriodInDays' => '2' },
    'domainInfo' => {
      'name' => domain.name,
      'description' => 'desc',
      'status' => 'REGISTERED',
    },
  }}

  let(:domains_desc) {
    {
      'domainInfos' => [
        domain_desc['domainInfo']
      ]
    }
  }

  context "Referring to a domain" do
    before :each do
      describe_domain_response.stub(:data).and_return(domain_desc)
      client.stub(:describe_domain).and_return(describe_domain_response)
      list_domains_response.stub(:data).and_return(domains_desc)
      client.stub(:list_domains).and_return(list_domains_response)
    end

    it "should return the domain for the test" do
      domain.should_not be_nil
      domain.should be_a(SimplerWorkflow::Domain)
    end

    it "should provide the domain name" do
      domain.name.should == "test-domain"
    end

    it "should show the default retention period" do
      domain.retention_period.should == 2
    end
  end

  context "getting a handle to the SimpleWorkflow API" do
    let(:swf) { SimplerWorkflow.swf }
    it "should return the SWF handle" do
      swf.should be_a AWS::SimpleWorkflow
    end

    it "should have the same configuration as AWS" do
      swf.config.should == AWS.config
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
simpler_workflow-0.3.3 spec/simpler_workflow_spec.rb
simpler_workflow-0.3.2 spec/simpler_workflow_spec.rb
simpler_workflow-0.3.1 spec/simpler_workflow_spec.rb
simpler_workflow-0.3.0 spec/simpler_workflow_spec.rb
simpler_workflow-0.3.0.beta2 spec/simpler_workflow_spec.rb
simpler_workflow-0.3.0.beta spec/simpler_workflow_spec.rb
simpler_workflow-0.2.7 spec/simpler_workflow_spec.rb
simpler_workflow-0.2.6 spec/simpler_workflow_spec.rb
simpler_workflow-0.2.5 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.12 spec/simpler_workflow_spec.rb
simpler_workflow-0.2.4 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.11 spec/simpler_workflow_spec.rb
simpler_workflow-0.2.3 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.10 spec/simpler_workflow_spec.rb
simpler_workflow-0.2.1 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.9 spec/simpler_workflow_spec.rb
simpler_workflow-0.2.0 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.8 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.7 spec/simpler_workflow_spec.rb
simpler_workflow-0.1.6 spec/simpler_workflow_spec.rb