Sha256: a4bac9a1e45036ac71a143a0aedee3a1410582a96007fea555cc222f7daa1855
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
describe "Demand file_address!" do it 'must fail if string has control characters' do lambda { d = Checked::Demand.new(File.expand_path "~/\tbashee") d.<< :file_address! }.should.raise(Checked::Demand::Failed) .message.should.match %r!has invalid characters: ! end end # === describe Demand file_address! describe "Demand not_dir!" do it 'must fail for an existing dir' do lambda { d = Checked::Demand.new(File.expand_path "~/") d.<< :not_dir! }.should.raise(Checked::Demand::Failed) end end # === describe Demand not_dir! describe "Demand not_file!" do it 'must fail for an existing file' do lambda { d = Checked::Demand.new(File.expand_path "~/.bashrc") d.<< :not_file! }.should.raise(Checked::Demand::Failed) end end # === describe Demand not_file! describe "Demand :file_content!" do it 'must fail for an empty string' do lambda { d = Checked::Demand.new('') d.<< :file_content! }.should.raise(Checked::Demand::Failed) .message.should.be == "String, \"\", can't be empty." end end # === describe Demand :file_content!
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
Checked-0.1.3 | spec/tests/Demand_File_Addresses.rb |
Checked-0.1.2 | spec/tests/Demand_File_Addresses.rb |