File: string-direction_spec.rb

package info (click to toggle)
ruby-string-direction 1.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 212 kB
  • sloc: ruby: 657; makefile: 7; sh: 3
file content (49 lines) | stat: -rw-r--r-- 1,331 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
require 'spec_helper'

describe StringDirection do
  it 'has a version number' do
    expect(described_class::VERSION).not_to be nil
  end

  describe '::LTR' do
    it "is 'ltr'" do
      expect(described_class::LTR).to eq('ltr')
    end
  end

  describe '::RTL' do
    it "is 'rtl'" do
      expect(described_class::RTL).to eq('rtl')
    end
  end

  describe '::BIDI' do
    it "is 'bidi'" do
      expect(described_class::BIDI).to eq('bidi')
    end
  end

  describe '::configure' do
    it 'initializes configuration instance var with an instance of StringDirection::Configuration' do
      described_class.configure {}

      expect(described_class.configuration).to be_an_instance_of(StringDirection::Configuration)
    end

    it 'yields the Configuration instance' do
      expect { |b| described_class.configure(&b) }.to yield_with_args(StringDirection.configuration)
    end
  end

  describe '#reset_configuration' do
    it 'sets its configuration instance var as a new instance of Configuration' do
      StringDirection.configure {}
      configuration = StringDirection.configuration

      StringDirection.reset_configuration

      expect(StringDirection.configuration).to be_an_instance_of(StringDirection::Configuration)
      expect(StringDirection.configuration).not_to eq(configuration)
    end
  end
end