From 88977bea7c644c009d46ca5d018aff6373d89ddc Mon Sep 17 00:00:00 2001 From: Robert Bavey Date: Mon, 31 Aug 2015 17:08:49 -0400 Subject: [PATCH] Add tests to ensure File.expand_path is used to calculate relative paths --- spec/red_storm/dsl/bolt_spec.rb | 6 ++++++ spec/red_storm/dsl/spout_spec.rb | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/spec/red_storm/dsl/bolt_spec.rb b/spec/red_storm/dsl/bolt_spec.rb index a512784..1c845ea 100644 --- a/spec/red_storm/dsl/bolt_spec.rb +++ b/spec/red_storm/dsl/bolt_spec.rb @@ -900,5 +900,11 @@ describe RedStorm::SimpleBolt do end end + describe 'inherited' do + it 'should calculate base class path correctly' do + expect(File).to receive(:expand_path).with(__FILE__) + class TestBolt < RedStorm::SimpleBolt; end + end + end end end diff --git a/spec/red_storm/dsl/spout_spec.rb b/spec/red_storm/dsl/spout_spec.rb index 7356a0c..1fbe1a8 100644 --- a/spec/red_storm/dsl/spout_spec.rb +++ b/spec/red_storm/dsl/spout_spec.rb @@ -895,5 +895,12 @@ describe RedStorm::SimpleSpout do spout.get_component_configuration.should be_instance_of(Backtype::Config) end end + + describe 'inherited' do + it 'should calculate base class path correctly' do + expect(File).to receive(:expand_path).with(__FILE__) + class TestSpout < RedStorm::SimpleSpout; end + end + end end end