This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| flexmock(User).should_receive(:find).with('42').and_return(jane) # Flexmock | |
| User.should_receive(:find).with('42').and_return(jane) # Rspec | |
| User.expects(:find).with('42').returns {jane} # Mocha | |
| User.should_receive(:find).with('42') {jane} # Rspec using return value blocks | |
| mock(User).find('42') {jane} # RR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void MainWindow::show_message() | |
| { | |
| std::stringstream title, content; | |
| title << "The first [" << m_spin_button.get_value_as_int() << "] lines"; | |
| Gtk::MessageDialog dialog(title.str()); | |
| std::ifstream file; | |
| file.open(m_file_chooser_button.get_filename().c_str(), std::ifstream::in); | |
| char buffer[512]; | |
| short i = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task :minitest do | |
| path = File.expand_path('test', Rails.root) | |
| require File.expand_path('test_helper', path) | |
| Dir[path + '/*_test.rb'].each do |file| | |
| require file | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kuba:Blog$ tree spec/ | |
| spec/ | |
| ├── controllers | |
| │ └── posts_controller_spec.rb | |
| ├── helpers | |
| │ └── posts_helper_spec.rb | |
| ├── models | |
| │ └── post_spec.rb | |
| ├── requests | |
| │ └── posts_spec.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $:.unshift './' | |
| require 'calculator' | |
| describe Calculator do | |
| describe :constructor do | |
| it 'should take many arguments' do | |
| args = [1, 2, 3, 4] | |
| Calculator.new(*args).values.should eq(args) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kuba:gosab$ tree | |
| . | |
| |-- src | |
| | `-- gosab | |
| | |-- api | |
| | | |-- sab_api.go | |
| | | `-- sab_api_test.go | |
| | |-- backend | |
| | | |-- connector | |
| | | | `-- connector.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "websocket" | |
| "http" | |
| "fmt" | |
| "io" | |
| ) | |
| func EchoServer(ws *websocket.Conn) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [48 32 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat sat_words | \ | |
| sed -e 's:^\(\w*\) .*:"\1":' \ | |
| -e 's:^\(\w*-\w*\) .*:"\1":' \ | |
| -e 's:^\(\w*-\w*-\w*\) .*:"\1":' \ | |
| -e 's:^\(\w*-\w*-\w*-\w*\) .*:"\1":' \ | |
| | sed -e ':a;N;$!ba;s:\n:,:g' \ | |
| -e 's:^:-[:' \ | |
| -e 's:-[:]:' | |
| # changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| goog.require('goog.testing.jsunit'); | |
| goog.require('example'); | |
| goog.require('goog.dom'); | |
| goog.require('goog.dom.NodeType'); | |
| var testHtmlEscaping = function() { | |
| example.sayHello('<b>greeting</b>'); | |
| var greetingEl = goog.dom.getElement('greeting'); | |
| assertEquals('The <h1 id="greeting"> element should only have one child node', |