Sha256: 0016bb269a9be5055a03f57a33c3d06b909fcce5ce8c344bd8f82f769c2a5e0d

Contents?: true

Size: 800 Bytes

Versions: 4

Compression:

Stored size: 800 Bytes

Contents

require File.expand_path('test_helper.rb', File.dirname(__FILE__))
require 'gir_ffi/overrides/gtk'

describe GirFFI::Overrides::Gtk do
  before do
    @gtk = Module.new do
      def self.init arr
        ["baz", "qux", "zonk"]
      end
    end
    stub(@gtk)._setup_method { }

    @gtk.instance_eval do
      include GirFFI::Overrides::Gtk
    end
  end

  context "The .init function" do
    should "not take any arguments" do
      assert_raises(ArgumentError) { @gtk.init 1, ["foo"] }
      assert_raises(ArgumentError) { @gtk.init ["foo"] }
      assert_nothing_raised { @gtk.init }
    end

    should "replace ARGV with the tail of the result of the original init function" do
      ARGV.replace ["foo", "bar"]
      @gtk.init
      assert_equal ["qux", "zonk"], ARGV.to_a
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.0.14 test/gtk_overrides_test.rb
gir_ffi-0.0.13 test/gtk_overrides_test.rb
gir_ffi-0.0.12 test/gtk_overrides_test.rb
gir_ffi-0.0.11 test/gtk_overrides_test.rb