George Opritescu

Developer from somewhere

using should_receive with cucumber

Add this in your env.rb file:

require 'cucumber/rspec/doubles'
Read More

running tests for capybara webkit in a headless environment

sudo apt-get install xvfb
DISPLAY=localhost:1.0 xvfb-run rake spec
Read More

move a tmux window

move-window -t 0
Read More

linx #1

  • Go channels: coop
  • Docker provisioning: fig
Read More

finding where a class file is defined

Get a handle on one of the methods:

m = YourClass.method(:some_method)
puts m.source_location
Read More

running rake tasks from the rails console

require "rake"
Your::Application.load_tasks
Rake::Task["some_task"].invoke # you'll also need reenable if calling a task multiple times
Read More

unknown provider eProvider

After minification, I received the error “unknown provider eProvider”. The solution was to switch from something like this:

controller: ($scope) ->
  $scope.closeModal = ->
    ModalService.close()

to something like this:

controller: ["$scope"
  ($scope) ->
    $scope.closeModal = ->
      ModalService.close()
]

I found the solution here

Read More

capybara checkbox

Here’s how you check a checkbox with capybara:

find("some_element").set(true)
Read More

swap panes in tmux

To swap panes in tmux, use this combination:

C-a C-o

Of course, it’s different if you don’t have C-a as your prefix.

Read More

getting rid of ubuntu menu

In case the Ubuntu menu cuts off your app’s menu ( had that happen with Eclipse ), you can start the app with the following setting:

UBUNTU_MENUPROXY= eclipse
Read More