diff --git a/lib/knapsack/adapters/minitest_adapter.rb b/lib/knapsack/adapters/minitest_adapter.rb index 6ea23bb..305695e 100644 --- a/lib/knapsack/adapters/minitest_adapter.rb +++ b/lib/knapsack/adapters/minitest_adapter.rb @@ -48,7 +48,7 @@ def set_test_helper_path(file_path) def self.test_path(obj) # Pick the first public method in the class itself, that starts with "test_" - test_method_name = obj.public_methods(false).select{|m| m =~ /^test(:|_)/ }.first + test_method_name = obj.public_methods(false).select{|m| m =~ /^test_/ }.first method_object = obj.method(test_method_name) full_test_path = method_object.source_location.first parent_of_test_dir_regexp = Regexp.new("^#{@@parent_of_test_dir}") diff --git a/spec/knapsack/adapters/minitest_adapter_spec.rb b/spec/knapsack/adapters/minitest_adapter_spec.rb index 6f9061e..764b415 100644 --- a/spec/knapsack/adapters/minitest_adapter_spec.rb +++ b/spec/knapsack/adapters/minitest_adapter_spec.rb @@ -122,26 +122,4 @@ def name it { should eq './spec/knapsack/adapters/minitest_adapter_spec.rb' } end - - describe 'shoulda context installed' do - class FakeUserTest - def test_user_age; end - - def name - "test_: on delete qqq should allow us to make another portfolio for that user. " - end - end - - let(:obj) { FakeUserTest.new } - - subject { described_class.test_path(obj) } - - before do - parent_of_test_dir = File.expand_path('../../../', File.dirname(__FILE__)) - parent_of_test_dir_regexp = Regexp.new("^#{parent_of_test_dir}") - described_class.class_variable_set(:@@parent_of_test_dir, parent_of_test_dir_regexp) - end - - it { should eq './spec/knapsack/adapters/minitest_adapter_spec.rb' } - end end