Sha256: d84f606aee3e91152f6d366a84ccc48f0cb15a3a71476c65b06a17317115098d

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

require 'ise'

describe ISE::Project do
 
  #Operate on the same file provided.
  subject { ISE::Project.load(File.expand_path('../test_data/project.xise', __FILE__)) }


  describe ".get_property" do

    it "should return the value of the provided project property " do
      subject.get_property('HDL Instantiation Template Target Language').should == 'VHDL'
      subject.get_property('ISim UUT Instance Name').should == 'UUT'
    end

  end

  #
  # Faculty for finding the top-level file.
  #
  describe ".top_level_file" do

    let(:relative_path) { './toplevel.vhd' }
    let(:full_path) { File.expand_path(relative_path, "#{__FILE__}/../test_data") } 

    context "when absolute_path is false" do
      it "should return a relative path to top-level file, as it appears in the project file" do
        subject.top_level_file(false).should == relative_path
      end
    end

    context "when absolute_path true, and the base path is known" do
      it "should return the absolute path to the file" do
        subject.top_level_file.should == full_path
      end
    end

  end

  #
  # Faculty for finding the most recent bit-file generated by a project.
  #
  describe ".bit_file" do

    let(:full_path) { File.expand_path('toplevel.bit', "#{__FILE__}/../test_data") } 

    it "should return the absolute path to the top-level bit file, if it exists" do
      subject.bit_file.should == full_path
    end

    it "should return nil if the given file does not exist" do
      subject.set_property('Output File Name', 'blah')
      subject.bit_file.should be_nil
    end

  end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-ise-1.0.0 spec/ise/project_spec.rb
ruby-ise-0.6.1 spec/ise/project_spec.rb