Skip to content

Commit

Permalink
Adding page method
Browse files Browse the repository at this point in the history
  • Loading branch information
oleander committed Apr 27, 2011
1 parent d2bf1c3 commit 6c31717
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--color
-fs
-Ilib
-Ispec
--require spec_helper
10 changes: 8 additions & 2 deletions lib/btjunkie.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module Btjunkie
# Your code goes here...
class Btjunkie
def page(page)
tap { @page = page }
end

def self.method_missing(meth, *args, &blk)
Btjunkie.new.send(meth, *args, &blk)
end
end
9 changes: 9 additions & 0 deletions spec/btjunkie_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "spec_helper"

describe Btjunkie do
describe "#page" do
it "should be possible pass a page" do
Btjunkie.page(10).should be_instance_of(Btjunkie)
end
end
end
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "rspec"
require "webmock/rspec"
require "btjunkie"

RSpec.configure do |config|
config.mock_with :rspec
end

0 comments on commit 6c31717

Please sign in to comment.