Quantcast
Channel: Anatoly Spektor – My Programming Blog
Browsing latest articles
Browse All 21 View Live

Image may be NSFW.
Clik here to view.

How to scaffold JavaScript Web Application in seconds using YEOMAN ? (example...

Hey guys, Today I want to discuss an issue that I have been recently facing, and how to solve it. The issue is: How to set up a new JavaScript web app as quickly as possible and start developing,...

View Article



Image may be NSFW.
Clik here to view.

How to stub an IP in Ruby on Rails, RSpec Version 3 ?

Often when you are writing unit tests, you want to mock your IP address. Some of the uses cases could be – you are checking if IP is within the certain range. For RSpec 2.x  mocking  IP would look like...

View Article

Image may be NSFW.
Clik here to view.

How to stub File.read in RSpec 3 [RAILS, TDD]?

  Recently, I have been doing whole bunch of spec rewriting from RSpec 2 to Rspec 3. As a result I have found that documentation is not that straightforward, and some cases you need to really spend...

View Article

Image may be NSFW.
Clik here to view.

How to mock file upload with RSpec 3.0 ? [SOLVED]

One more note on RSpec 3.0, this time one useful function that mocks File Upload , saves file/archive content to memory so after it you can do whatever your soul wants with it. Test file/archive should...

View Article

Image may be NSFW.
Clik here to view.

How to ensure that filename is always unique ? [Ruby]

Hey guys! Happy New Year! I am glad to be back this year with some interesting news. Thank you for blasting my mailbox with your questions and suggestions! I will do my best to answer all of them as...

View Article


Image may be NSFW.
Clik here to view.

Tutorial: How to get data from external API ? PART 1: Getting API Key,...

I have gotten numerous emails with this question. I have decided to build a small app, that is based on the external API. Why do you need to get data from external API ? If you are asking this...

View Article

Image may be NSFW.
Clik here to view.

Tutorial: How to get data from external API ? PART 2: Sending Request,...

Here we are with Part 2 of our tutorial. Who missed the first part – it’s here. Also if you missed it please take a look at the Github Movies-CLI app, which I am taking my examples from. In this part...

View Article

Image may be NSFW.
Clik here to view.

How to reverse a String not using built-in reverse method ? How to reverse...

Hello again! I am continuing answering to your questions, this one came from marthab86_. marthab86_ asks: “I know Ruby has .reverse! , but can you show me how to actually reverse a word or a sentence...

View Article


Image may be NSFW.
Clik here to view.

How to measure your Ruby method performance ? [Ruby, Benchmark]

Hey Guys, Today, we will use our reverse methods that we have built in the previous post and measure how good they are comparing to the Ruby built in reverse method. For this purpose we will use Ruby...

View Article


Image may be NSFW.
Clik here to view.

10 ways how to speed your unit tests [Rails, RSpec, Capybara]

#10 Avoid writing to the database Lets take simple example. I have this test: require 'rails_helper' describe Address do let (:address) {create(:address)} it 'should be valid' do expect(address).to...

View Article
Browsing latest articles
Browse All 21 View Live




Latest Images