File: relationships_spec.rb

package info (click to toggle)
ruby-roo 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,216 kB
  • sloc: ruby: 6,529; xml: 88; makefile: 6
file content (43 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# frozen_string_literal: true

require "spec_helper"

describe Roo::Excelx::Relationships do
  subject(:relationships) { Roo::Excelx::Relationships.new Roo::Excelx.new(path).rels_files[0] }

  describe "#include_type?" do
    [
      ["with hyperlink type", "test/files/link.xlsx", true, false],
      ["with nil path", "test/files/Bibelbund.xlsx", false, false],
      ["with comments type", "test/files/comments-google.xlsx", false, true],
    ].each do |context_desc, file_path, hyperlink_value, comments_value|
      context context_desc do
        let(:path) { file_path }

        it "should return #{hyperlink_value} for hyperlink" do
          expect(subject.include_type?("hyperlink")).to be hyperlink_value
        end

        it "should return #{hyperlink_value} for link" do
          expect(subject.include_type?("link")).to be hyperlink_value
        end

        it "should return false for hypelink" do
          expect(subject.include_type?("hypelink")).to be false
        end

        it "should return false for coment" do
          expect(subject.include_type?("coment")).to be false
        end

        it "should return #{comments_value} for comments" do
          expect(subject.include_type?("comments")).to be comments_value
        end

        it "should return #{comments_value} for comment" do
          expect(subject.include_type?("comment")).to be comments_value
        end
      end
    end
  end
end