summaryrefslogtreecommitdiffstats
path: root/spec/eina_spec.rb
blob: 65fe7139026d5589c50c3c212b0c9b541830c8df (plain)
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
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
require 'efl/eina'
#
describe "Efl::Eina #{Efl::Eina.version.full}" do
    before(:all) do
        @init = Efl::Eina.init
    end
    after(:all) do
        Efl::Eina.shutdown
    end
    #
    it "should init" do
        Efl::Eina.init.should == @init+1
        Efl::Eina.init.should == @init+2
        Efl::Eina.init.should == @init+3
    end
    #
    it "should be main thread" do
        Efl::Eina.main_loop_is.should be_true
        if RUBY_VERSION > "1.9.0"
            Thread.new do
                Efl::Eina.main_loop_is.should be_false
            end.join
        else
            puts "  no bother on 1.8 branch"
        end
    end
    #
    it "should shutdown" do
        Efl::Eina.shutdown.should == @init+2
        Efl::Eina.shutdown.should == @init+1
        Efl::Eina.shutdown.should == @init
    end
    #
end