File: simple_table_spec.rb

package info (click to toggle)
ruby-aruba 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,972 kB
  • sloc: ruby: 7,151; javascript: 6,850; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "spec_helper"
require "aruba/platform"

RSpec.describe ".simple_table" do
  context "when valid hash" do
    let(:hash) do
      {
        key1: "value",
        key2: "value"
      }
    end
    let(:rows) { ["# key1 => value", "# key2 => value"] }

    it { expect(Aruba.platform.simple_table(hash).to_s).to eq rows.join("\n") }
  end

  context "when empty hash" do
    let(:hash) { {} }
    let(:rows) { [] }

    it { expect(Aruba.platform.simple_table(hash).to_s).to eq rows.join("\n") }
  end
end