Sha256: bad510c7f08cbbebb5a07344b6a19b5e800722332827194787f8648f38680b48

Contents?: true

Size: 884 Bytes

Versions: 3

Compression:

Stored size: 884 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe RTurk::Requester do

  before(:all) do
    aws = YAML.load(File.open(File.join(SPEC_ROOT, 'mturk.yml')))
    @turk = RTurk::Requester.new(aws['AWSAccessKeyId'], aws['AWSAccessKey'], :sandbox => true)
  end

  it "should perform raw operations" do
    @turk.request(:Operation => 'GetHIT', 'HITId' => 'test')['HIT']['Request'].include?('Errors').should be_true
  end
  
  it "should also interpret methods as operations" do
    @turk.getHIT(:HITId => 'test')
  end
  
  it "should return its environment" do 
    @turk.environment.should == 'sandbox'
  end
  
  it "should return its environment as production, the default" do
    aws = YAML.load(File.open(File.join(SPEC_ROOT, 'mturk.yml')))
    @turk = RTurk::Requester.new(aws['AWSAccessKeyId'], aws['AWSAccessKey'])
    @turk.environment.should == 'production'
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
markpercival-rturk-1.0.3 spec/requester_spec.rb
markpercival-rturk-1.0.4 spec/requester_spec.rb
markpercival-rturk-1.0.5 spec/requester_spec.rb