spec/BtSync/bt_sync_spec.rb in BtSync-0.4.4 vs spec/BtSync/bt_sync_spec.rb in BtSync-0.5.0

- old
+ new

@@ -18,9 +18,69 @@ @settings = @bt.get_settings end @settings["devicename"].should == "IceyEC-Virtual1" @settings["listeningport"].should == 63754 end + it "can get listening port" do + VCR.use_cassette("get-settings") do + @bt.listening_port.should == 63754 + end + end + it "can get upload limit" do + VCR.use_cassette("get-settings") do + @bt.upload_limit.should == 0 + end + end + it "can get download limit" do + VCR.use_cassette("get-settings") do + @bt.download_limit.should == 0 + end + end + it "can get device name" do + VCR.use_cassette("get-settings") do + @bt.device_name.should == "IceyEC-Virtual1" + end + end + it "can change the device_name" do + VCR.use_cassette("change_name") do + @bt.device_name = "IceyEC-Virtual2" + @bt.device_name.should == "IceyEC-Virtual2" + end + VCR.use_cassette('reset_device_name') do + @bt.device_name = "IceyEC-Virtual1" + @bt.device_name.should == "IceyEC-Virtual1" + end + end + it "can change the upload limit" do + VCR.use_cassette("change_upload_limit") do + @bt.upload_limit = 1000 + @bt.upload_limit.should == 1000 + end + VCR.use_cassette('reset_upload_limit') do + @bt.upload_limit = 0 + @bt.upload_limit.should == 0 + end + end + it "can change the download limit" do + VCR.use_cassette("change_download_limit") do + @bt.download_limit = 1000 + @bt.download_limit.should == 1000 + end + VCR.use_cassette('reset_download_limit') do + @bt.download_limit = 0 + @bt.download_limit.should == 0 + end + end + it "can change the listening_port" do + VCR.use_cassette("change_listening_port") do + @bt.listening_port = 12345 + @bt.listening_port.should == 12345 + end + VCR.use_cassette('reset_listening_port') do + @bt.listening_port = 63754 + @bt.listening_port.should == 63754 + end + end it "can check the OS" do VCR.use_cassette("get-os-type") do @os = @bt.get_os_type end @os.should == "linux" \ No newline at end of file