Skip to content

Commit

Permalink
Merge 2904d6f into c7b9958
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Jan 8, 2020
2 parents c7b9958 + 2904d6f commit 8dd7bcd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 21 deletions.
43 changes: 39 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,50 @@
FROM ruby:2.3.1
# Instructions
# ------------
#
# Build the Docker image using:
#
# docker build -t test-gir_ffi .
#
# You can pick any image name instead of test-gir_ffi, of course. After the
# build is done, run bash interactively inside the image like so:
#
# docker run -v $PWD:/gir_ffi --rm -it test-gir_ffi:latest bash
#
# The `-v $PWD:/gir_ffi` will make the container pick up any changes to the
# code, so you can edit and re-run the tests.

FROM ruby:2.4

RUN apt-get update
RUN apt-get install -y libgirepository1.0-dev
RUN apt-get install -y libcairo2-dev
# Provides libgirepository-1.0.so.1
RUN apt-get install -y libgirepository-1.0-1
# Provides source code for test libraries and tools to generate introspection data
RUN apt-get install -y gobject-introspection
# Provides gir files for various libraries, needed for generating gir files
# for test libraries
RUN apt-get install -y libgirepository1.0-dev
# The following packages provide typelibs for various libraries
RUN apt-get install -y gir1.2-gtop-2.0
RUN apt-get install -y gir1.2-gtk-3.0
RUN apt-get install -y gir1.2-pango-1.0
RUN apt-get install -y gir1.2-secret-1
RUN apt-get install -y gir1.2-gstreamer-1.0
RUN apt-get install -y gir1.2-gtk-3.0
RUN apt-get install -y gir1.2-gtksource-3.0

RUN gem update bundler

RUN mkdir /gir_ffi
WORKDIR /gir_ffi

# Add just the files needed for running bundle
ADD gir_ffi.gemspec /gir_ffi/gir_ffi.gemspec
ADD Gemfile /gir_ffi/Gemfile
ADD lib/gir_ffi/version.rb /gir_ffi/lib/gir_ffi/version.rb
# Yes we need to add the git repo for now
ADD .git /gir_ffi/.git

# Install dependencies
RUN bundle

# Add the full source code
ADD . /gir_ffi
23 changes: 6 additions & 17 deletions test/integration/generated_gtk_source_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@

require "gir_ffi_test_helper"

GirFFI.setup :GtkSource
GirFFI.setup :GtkSource, "3.0"

# Tests behavior of objects in the generated GtkSource namespace.
describe "The generated GtkSource module" do
describe "GtkSource::CompletionContext" do
let(:instance) { GtkSource::CompletionContext.new }

it "allows adding proposals" do
# Interface changed in GtkSourceView 3.24
proposals = if GtkSource::CompletionItem.instance_methods.include? :set_label
Array.new(3) do |i|
GtkSource::CompletionItem.new.tap do |item|
item.label = "Proposal #{i}"
item.text = "Proposal #{i}"
item.info = "blah #{i}"
end
end
else
[
GtkSource::CompletionItem.new("Proposal 1", "Proposal 1", nil, "blah 1"),
GtkSource::CompletionItem.new("Proposal 2", "Proposal 2", nil, "blah 2"),
GtkSource::CompletionItem.new("Proposal 3", "Proposal 3", nil, "blah 3")
]
end
proposals = [
GtkSource::CompletionItem.new("Proposal 1", "Proposal 1", nil, "blah 1"),
GtkSource::CompletionItem.new("Proposal 2", "Proposal 2", nil, "blah 2"),
GtkSource::CompletionItem.new("Proposal 3", "Proposal 3", nil, "blah 3")
]
instance.add_proposals nil, proposals, true
end
end
Expand Down

0 comments on commit 8dd7bcd

Please sign in to comment.