Sha256: 8806c222b7ab3f3270f1e77fda674bb952b8a7d42afb542e64e45b08e81fe8c5

Contents?: true

Size: 745 Bytes

Versions: 5

Compression:

Stored size: 745 Bytes

Contents

require_relative "list_topics.rb"

require "rspec"

describe "list_topics" do
  before(:all) do
    @topics = read_topic_file("topics-test.csv")
  end

  describe "#read_topic_file" do
    it "reads all topics" do
      expect(@topics.keys).to eq(["One", "Three", "Two"])
    end

    it "reads libraries for topic" do
      expect(@topics["One"]).to eq(["liba", "libd"])
      expect(@topics["Two"]).to eq(["libd", "libb", "libe"])
      expect(@topics["Three"]).to eq(["libc"])
    end
  end

  describe "#print_topics" do
    it "prints all topics" do
      expected_output = <<EOT
One (2): liba, libd
Three (1): libc
Two (3): libb, libd, libe
EOT
      expect { print_topics(@topics) }.to output(expected_output).to_stdout
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inqlude-0.12.0 topics/list_topics_spec.rb
inqlude-0.11.0 topics/list_topics_spec.rb
inqlude-0.10.0 topics/list_topics_spec.rb
inqlude-0.9.0 topics/list_topics_spec.rb
inqlude-0.8.0 topics/list_topics_spec.rb