File: dash_spec.rb

package info (click to toggle)
ruby-rghost 0.9.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,188 kB
  • sloc: ruby: 3,374; makefile: 6; sh: 1
file content (19 lines) | stat: -rw-r--r-- 662 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

RSpec.describe RGhost::Dash do
  it "should set dash values" do
    options = RGhost::Dash::DEFAULT_OPTIONS
    dash = RGhost::Dash.new
    expect(dash.ps.strip).to eq("[#{options[:style].join(" ")}] #{options[:offset]} setdash")
  end

  it "should set create a dash with options" do
    dash = RGhost::Dash.new({style: [2, 1, 3, 1, 2, 1, 3], offset: 1})
    expect(dash.ps.strip).to eq("[2 1 3 1 2 1 3] 1 setdash")
  end

  it "should set create a dash with options and other offset" do
    dash = RGhost::Dash.new({style: [2, 1, 3, 1, 2, 1, 3], offset: 2})
    expect(dash.ps.strip).to eq("[2 1 3 1 2 1 3] 2 setdash")
  end
end