spec/lib/hackpad/cli/client_spec.rb in hackpad-cli-0.1.1 vs spec/lib/hackpad/cli/client_spec.rb in hackpad-cli-0.1.2

- old
+ new

@@ -47,11 +47,11 @@ before { FileUtils.mkdir_p workspacedir2 } before { File.open(workspacefile2, 'w') { |f| f.puts YAML.dump(workspacevars2) } } after { FileUtils.rm workspacefile2 if File.exist?(workspacefile2) } it do - expect(output).to receive(:printf).with(format, 'default', 'http://example.com') + expect(output).to receive(:printf).with(format, '> default', 'http://example.com') expect(output).to receive(:printf).with(format, 'default2', 'http://2.example.com') client.workspaces end end @@ -64,13 +64,11 @@ before { FileUtils.mkdir_p workspacedir2 } before { File.open(workspacefile2, 'w') { |f| f.puts YAML.dump(workspacevars2) } } after { FileUtils.rm workspacefile2 if File.exist?(workspacefile2) } it do - expect(output).to receive(:puts).with('What workspace do you want to use as default from now on?') - expect(output).to receive(:printf).with("> %-3s %s\n", 0, "default") - expect(output).to receive(:printf).with(" %-3s %s\n", 1, "default2") + expect(output).to receive(:print).with("What workspace do you want to use as default from now on? \n> 0 default\n 1 default2\nChoose a number: [0] ") client.default expect(YAML.load_file(configfile)['workspace']).to eq 'default2' end end @@ -238,15 +236,10 @@ client.show '123', 'html' end end context 'when a markdown version is asked,' do - before { pad.stub(:content).and_return('<ul><li>this is content</li></ul>') } - before do - ReverseMarkdown.stub(:convert) - .with('<ul><li>this is content</li></ul>', github_flavored: true) - .and_return('- this is content') - end + before { pad.stub(:content).and_return('- this is content') } it do expect(output).to receive(:puts).with('- this is content') client.show '123', 'md' end end