Sha256: 03dc331332f2a7c128a0afd858f4695924ae318db16577e978e4002dd8da9aec

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

require 'rjobs/job'
require 'data_helper'
describe "Job Spec" do
  before(:each) do

    @jobAttributes = DataHelper.jobAttributes
    @job = Rjobs::Job.new(0,@jobAttributes)

  end
  it "should exist a class name Job" do    
    @job.should_not == nil
  end

  it "should have an id attribute" do
    @job.id = 123
    @job.id.should == 123
  end 

  it "should have a name attribute" do
    @job.name = "TestJob"
    @job.name.should == "TestJob"
  end

  it "can get attribute name from xml attribute" do
    @job.name.should == 'MyFirstJob'
  end

  it "should have a status attribute" do
    @job.status = "Pending"
    @job.status.should == "Pending"
  end

  it "should get status from xml attribute" do
    @job.status.should == "Finished"
  end

  it "should parse xml when assign to xml attribute reader" do
    @job.xml = @jobAttributes
    @job.status.should == "Finished"    
  end

  it "should have a command attributes" do
    @job.command = "test"
    @job.params = {:a => "a", :b => "b" , "this is test" => ""}
    @job.command.should == "test -a a -b b this is test"
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rjobs-0.3.3.alpha spec/lib/job_spec.rb
rjobs-0.3.2.alpha spec/lib/job_spec.rb
rjobs-0.3.1.alpha spec/lib/job_spec.rb
rjobs-0.3.0.alpha spec/lib/job_spec.rb
rjobs-0.2.0.alpha spec/lib/job_spec.rb
rjobs-0.1.0.alpha spec/lib/job_spec.rb