Skip to content

Commit 8d6a332

Browse files
committed
Stub instance method even if called in initializer
This should fix build.
1 parent aad1712 commit 8d6a332

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ group :development, :test do
55
gem 'rubocop', require: false
66
gem 'codeclimate-test-reporter', require: nil
77
gem 'fakefs', require: 'fakefs/safe'
8+
gem 'rspec'
89
end

spec/dex-oracle/driver_spec.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
allow(File).to receive(:open).and_yield(temp_file)
1818
allow(File).to receive(:read)
1919
allow(JSON).to receive(:parse)
20-
allow(Driver).to receive(:get_driver_dir).and_return('/data/local')
20+
allow_any_instance_of(Driver).to receive(:get_driver_dir).and_return('/data/local')
2121
Driver.new(device_id)
2222
end
2323
let(:driver_stub) { 'export CLASSPATH=/data/local/od.zip; app_process /system/bin org.cf.oracle.Driver' }
@@ -54,7 +54,6 @@
5454
context 'with integer arguments' do
5555
subject { driver.run(class_name, method_signature, *args) }
5656
it do
57-
allow(driver).to receive(:drive)
5857
expect(driver).to receive(:drive).with("#{driver_stub} 'some.Klazz' 'run' I:1 I:2 I:3")
5958
subject
6059
end
@@ -71,7 +70,6 @@
7170

7271
subject { driver.run(class_name, method_signature, args) }
7372
it do
74-
allow(driver).to receive(:drive)
7573
expect(driver).to receive(:drive).with(
7674
"#{driver_stub} 'string.Klazz' 'run' java.lang.String:[104,101,108,108,111,32,115,116,114,105,110,103]"
7775
)

0 commit comments

Comments
 (0)