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