Skip to content

Commit d0b155a

Browse files
author
Sven Riedel
committed
Initial commit
0 parents  commit d0b155a

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--color

lib/bri.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$: << File.dirname( __FILE__ )
2+
require 'bri/matcher'
3+
4+
module Bri
5+
def self.ri( query )
6+
results = Bri::Matcher.find( query )
7+
8+
if results.size == 0
9+
"No matching results found"
10+
end
11+
end
12+
end
13+

lib/bri/matcher.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Bri
2+
class Matcher
3+
def self.find( query )
4+
[]
5+
end
6+
end
7+
end

spec/lib/bri_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require 'spec_helper'
2+
3+
describe Bri do
4+
context "a query with one result" do
5+
it "should show the methods description"
6+
end
7+
8+
context "a query with multiple results" do
9+
it "should list fully qualified matching method names"
10+
end
11+
12+
context "a query with no results" do
13+
before( :each ) do
14+
Bri::Matcher.stub!( :find ).and_return( [] )
15+
end
16+
17+
it "should say nothing matched" do
18+
Bri.ri( "I#dont_exist" ).should == "No matching results found"
19+
end
20+
end
21+
end

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require File.join( File.dirname( __FILE__ ), '..', 'lib', 'bri.rb' )

0 commit comments

Comments
 (0)