Skip to content

Commit

Permalink
Add a basic spec for LoadTracking.add_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kgrz committed Oct 6, 2015
1 parent ba7c7d7 commit 99f4208
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions rubygem/spec/load_tracking_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require 'spec_helper'

describe "Zeus::LoadTracking" do
let(:test_filename) { __FILE__ }
let(:test_dirname) { File.dirname(test_filename) }

describe '.add_feature' do
context 'already in load path' do
before do
# add the dir path of the tempfile to LOAD_PATH
$LOAD_PATH << test_dirname
end

after { $LOAD_PATH.delete test_dirname }


it 'adds full filepath to $untracked_features' do
Zeus::LoadTracking.add_feature(test_filename)

expect($untracked_features).to include(__dir__ + "/load_tracking_spec.rb")
end
end

context 'not in load path' do
it 'adds full filepath to $untracked_features' do
Zeus::LoadTracking.add_feature(test_filename)

expect($untracked_features).to include(__dir__ + "/load_tracking_spec.rb")
end
end
end
end

0 comments on commit 99f4208

Please sign in to comment.