Permalink
Browse files

clean up a few files

  • Loading branch information...
1 parent a898392 commit 56370b0ecb765e3061947535d3925fc7b3955b0a @asceth committed Feb 4, 2011
Showing with 47 additions and 40 deletions.
  1. +10 −0 Gemfile.lock
  2. +15 −13 Rakefile
  3. +0 −27 lib/debug_bbcoder.rb
  4. +21 −0 spec/buffer_tags_spec.rb
  5. +1 −0 spec/spec_helper.rb
View
@@ -1,10 +1,20 @@
GEM
remote: http://rubygems.org/
specs:
+ diff-lcs (1.1.2)
rr (1.0.2)
+ rspec (2.4.0)
+ rspec-core (~> 2.4.0)
+ rspec-expectations (~> 2.4.0)
+ rspec-mocks (~> 2.4.0)
+ rspec-core (2.4.0)
+ rspec-expectations (2.4.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.4.0)
PLATFORMS
ruby
DEPENDENCIES
rr
+ rspec
View
@@ -1,17 +1,19 @@
+require "bundler"
+Bundler.setup
-begin
- require 'bones'
-rescue LoadError
- abort '### Please install the "bones" gem ###'
-end
+require "rspec"
+require "rspec/core/rake_task"
+
+Rspec::Core::RakeTask.new(:spec)
+
+gemspec = eval(File.read(File.join(Dir.pwd, "bbcoder.gemspec")))
-task :default => 'test:run'
-task 'gem:release' => 'test:run'
+task :build => "#{gemspec.full_name}.gem"
-Bones {
- name 'bbcoder'
- authors 'John "asceth" Long'
- email 'machinist@asceth.com'
- url 'http://github.com/asceth/bbcoder'
-}
+task :test => :spec
+
+file "#{gemspec.full_name}.gem" => gemspec.files + ["bbcoder.gemspec"] do
+ system "gem build bbcoder.gemspec"
+ system "gem install bbcoder-#{BBCoder::VERSION}.gem"
+end
View
@@ -1,27 +0,0 @@
-require 'bbcoder'
-
-class DebugBBCoder < BBCoder
- def tag_end(tag)
- if DEBUG
- STDERR.puts "tag_end: #{tag}"
- STDERR.puts "open_tags: #{@open_tags.inspect}"
- STDERR.puts "buffer: #{@buffer.inspect}"
- end
- super(tag)
- end
-
- def tag_open(tag)
- STDERR.puts "tag_open: #{tag}" if DEBUG
- super(tag)
- end
-
- def finish_buffer
- if DEBUG
- STDERR.puts "finish buffer"
- STDERR.puts "open_tags: #{@open_tags.inspect}"
- STDERR.puts "buffer: #{@buffer.inspect}"
- end
-
- super
- end
-end
View
@@ -22,5 +22,26 @@
subject.criteria_met?(:p).should == true
end
end
+
+ context "delegation to _internal" do
+ it "#size" do
+ mock(subject)._internal.stub!.size
+ subject.size
+ end
+
+ it "#empty?" do
+ mock(subject)._internal.stub!.empty?
+ subject.empty?
+ end
+ it "#last" do
+ mock(subject)._internal.stub!.last
+ subject.last
+ end
+
+ it "#include?" do
+ mock(subject)._internal.stub!.include?
+ subject.include?(:p)
+ end
+ end
end
View
@@ -2,6 +2,7 @@
require 'bundler'
Bundler.setup
+require 'rspec'
require 'bbcoder'
RSpec.configure do |config|

0 comments on commit 56370b0

Please sign in to comment.