Projects

Ticket #336: macruby.shoulda.rb

File macruby.shoulda.rb, 0.6 KB (added by macruby@…, 3 years ago)

Shoulda test example

Line 
1require 'test/unit'
2require 'rubygems'
3require 'shoulda'
4require 'shoulda/test_unit'
5
6framework 'Foundation'
7
8class MacRubyShouldaTest < Test::Unit::TestCase
9  context "NSString instance" do
10    setup do
11      @string = NSString.stringWithString("~/Documents")
12    end
13    should "expand tilde in path" do
14      # The assert_equal fails for some reason, == might not be right...
15      # assert_equal "#{ENV['HOME']}/Documents", @string.stringByExpandingTildeInPath
16      assert @string.stringByExpandingTildeInPath.isEqualToString("#{ENV['HOME']}/Documents")
17    end
18  end
19end