Sha256: d0d0be896fd2f1125cd6a65da7eefb4165761339287d0f2710a84835c47af366

Contents?: true

Size: 1.33 KB

Versions: 152

Compression:

Stored size: 1.33 KB

Contents

if Appsignal::System.jruby?
  describe Appsignal::Extension::Jruby do
    let(:extension) { Appsignal::Extension }

    describe "string conversions" do
      it "keeps the same value during string type conversions" do
        # UTF-8 string with NULL
        # Tests if the conversions between the conversions without breaking on
        # NULL terminated strings in C.
        string = "Merry Christmas! \u0000 🎄"

        appsignal_string = extension.make_appsignal_string(string)
        ruby_string = extension.make_ruby_string(appsignal_string)

        expect(ruby_string).to eq("Merry Christmas! \u0000 🎄")
      end
    end

    it "loads libappsignal with FFI" do
      expect(described_class.ffi_libraries.map(&:name).first).to include "libappsignal"
    end

    describe ".lib_extension" do
      subject { described_class.lib_extension }

      context "when on a darwin system" do
        before { expect(Appsignal::System).to receive(:agent_platform).and_return("darwin") }

        it "returns the extension for darwin" do
          is_expected.to eq "dylib"
        end
      end

      context "when on a linux system" do
        before { expect(Appsignal::System).to receive(:agent_platform).and_return("linux") }

        it "returns the lib extension for linux" do
          is_expected.to eq "so"
        end
      end
    end
  end
end

Version data entries

152 entries across 152 versions & 1 rubygems

Version Path
appsignal-2.10.12 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.12-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.11 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.11-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.4 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.4-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.3 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.3-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.10 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.10-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.2 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.2-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.1-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.beta.1 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.alpha.2 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.alpha.2-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.alpha.1 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.11.0.alpha.1-java spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.9 spec/lib/appsignal/extension/jruby_spec.rb
appsignal-2.10.9-java spec/lib/appsignal/extension/jruby_spec.rb