Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
banister committed Oct 11, 2010
1 parent 2b06faa commit f354a71
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
direc = File.dirname(__FILE__)
require 'rubygems'
require 'bacon'
require "#{direc}/../lib/mixico"

describe "mix_eval" do
before do
@m = Module.new {
def hello
:hello
end
}
end

it 'should provide a mix_eval method to Object' do
Object.method_defined?(:mix_eval).should.equal true
end

it 'should make "hello" method available to block' do
mix_eval(@m) { should.respond_to(:hello) }
end

it 'should make "hello" method unavailable outside the block' do
mix_eval(@m) { hello }
should.not.respond_to(:hello)
end

it 'should makke "hello" method return :hello' do
mix_eval(@m) { hello.should.equal :hello }
end
end



0 comments on commit f354a71

Please sign in to comment.