spec/spec.sane.rb in sane-0.23.6 vs spec/spec.sane.rb in sane-0.24.0
- old
+ new
@@ -28,10 +28,11 @@
#Object.send(:remove_const, 'Klass') rescue nil
end
it "should have working __DIR__" do
__DIR__.should_not == nil
+ __DIR__[-1].should_not == '/' # not ending slash, that feels weird in real use.
end
it "should write to files" do
filename = __DIR__ + '/test'
File.write(filename, "abc\n")
@@ -40,14 +41,10 @@
assert(File.binread(filename) == "abc\r\n") # it should have written it out *not* in binary mode
end
File.delete filename
end
- it "should have __dir__ too" do
- __dir__.should_not be_nil
- end
-
class A
def go; 3; end
end
it "should have a singleton_class method" do
@@ -177,16 +174,11 @@
a = Thread.new { sleep 1 }
assert Benchmark.realtime{Thread.join_all_others} > 0.5
end
it "should have an insert commas operator on numbers" do
- 1_000_000.comma_format.should == '1,000,000'
- 1_000_000.0.comma_format.should == '1,000,000.0'
- 1_000_000.0.comma_format.should == '1,000,000.0'
+ 1_000_000.group_digits.should == '1,000,000'
+ 1_000_000.0.group_digits.should == '1,000,000.0'
+ 1_000_000.03555.group_digits.should == '1,000,000.03555'
end
-
- it 'should have socket ips' do
- Socket.get_host_ips.length.should be > 0
- end
-
end