forked from rkh/mixico
/
test.rb
36 lines (28 loc) · 773 Bytes
/
test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
direc = File.dirname(__FILE__)
require 'rubygems'
require 'bacon'
require "#{direc}/../lib/mixico"
puts "Testing Mixico version #{Mixico::VERSION}..."
puts "Ruby version #{RUBY_VERSION}"
describe Mixico 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