Sha256: 1400b59f8e3054d55628cd219a5fc9a05f1a3790795a8a7dd428ae54027272a8

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 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 RuntimeError when passed unknown targets" do
      task = Task.new

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

    describe "x86" do
      before(:all) do
        @task = Task.new { |task| task.target! :x86 }
      end

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

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

    describe "amd64" do
      before(:all) do
        @task = Task.new { |task| task.target! :amd64 }
      end

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

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

    describe "lc3b" do
      before(:all) do
        @task = Task.new { |task| task.target! :lc3b }
      end

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-yasm-0.2.0 spec/task_spec.rb
ruby-yasm-0.1.1 spec/task_spec.rb