File: load_spec.rb

package info (click to toggle)
ruby-immutable-ruby 0.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,852 kB
  • sloc: ruby: 16,556; makefile: 4
file content (42 lines) | stat: -rw-r--r-- 1,400 bytes parent folder | download
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
# It should be possible to require any one Immutable structure,
# without loading all the others

immutable_lib_dir = File.join(File.dirname(__FILE__), '..', '..', 'lib')

describe :Immutable do
  describe :Hash do
    it 'can be loaded separately' do
      system(%{ruby -e "$:.unshift('#{immutable_lib_dir}'); require 'immutable/hash'; Immutable::Hash.new"}).should be(true)
    end
  end

  describe :Set do
    it 'can be loaded separately' do
      system(%{ruby -e "$:.unshift('#{immutable_lib_dir}'); require 'immutable/set'; Immutable::Set.new"}).should be(true)
    end
  end

  describe :Vector do
    it 'can be loaded separately' do
      system(%{ruby -e "$:.unshift('#{immutable_lib_dir}'); require 'immutable/vector'; Immutable::Vector.new"}).should be(true)
    end
  end

  describe :List do
    it 'can be loaded separately' do
      system(%{ruby -e "$:.unshift('#{immutable_lib_dir}'); require 'immutable/list'; Immutable::List[]"}).should be(true)
    end
  end

  describe :SortedSet do
    it 'can be loaded separately' do
      system(%{ruby -e "$:.unshift('#{immutable_lib_dir}'); require 'immutable/sorted_set'; Immutable::SortedSet.new"}).should be(true)
    end
  end

  describe :Deque do
    it 'can be loaded separately' do
      system(%{ruby -e "$:.unshift('#{immutable_lib_dir}'); require 'immutable/deque'; Immutable::Deque.new"}).should be(true)
    end
  end
end