Sha256: 9970a40aa6f0a9456667c048d3ebf8b4bd88a763dedbd19a739a96887d7cb70f

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

require 'yasm/task'

require 'spec_helper'

describe Task do
  it "should support a :target option" do
    task = Task.new(:target => :amd64)

    task.arch.should == :x86
    task.machine.should == :amd64
  end

  describe "target!" do
    it "should return true for valid targets" do
      task = Task.new

      task.target!(:amd64).should == true
    end

    it "should raise ArgumentError when passed unknown targets" do
      task = Task.new

      lambda {
        task.target! :lol
      }.should raise_error(ArgumentError)
    end

    describe "x86" do
      subject do
        Task.new { |task| task.target! :x86 }
      end

      it "should set the arch value" do
        subject.arch.should == :x86
      end

      it "should set the machine value" do
        subject.machine.should == :x86
      end
    end

    describe "amd64" do
      subject do
        Task.new { |task| task.target! :amd64 }
      end

      it "should set the arch value" do
        subject.arch.should == :x86
      end

      it "should set the machine value" do
        subject.machine.should == :amd64
      end
    end

    describe "lc3b" do
      subject do
        Task.new { |task| task.target! :lc3b }
      end

      it "should set the arch value" do
        subject.arch.should == :lc3b
      end

      it "should set the machine value" do
        subject.machine.should == :lc3b
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-yasm-0.2.1 spec/task_spec.rb