This file contains 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
RSpec::Matchers.define :be_less_than do |expected| | |
match do |actual| | |
result = actual<expected | |
result &&=actual>@low_value unless @low_value.nil? | |
result | |
end | |
chain :and_greater_than do |low_value| | |
@low_value=low_value | |
end | |
description do |
This file contains 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
describe 10 do | |
it {should be_less_than(11).and_greater_than(5)} | |
end |
This file contains 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
RSpec::Matchers.define :be_less_than do |expected| | |
match do |actual| | |
result = actual<expected | |
result &&=actual>@low_value unless @low_value.nil? | |
result | |
end | |
chain :and_greater_than do |low_value| | |
@low_value=low_value | |
end | |
end |
This file contains 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
describe 10 do | |
it {should be_less_than 11} | |
it {should_not be_less_than 5} | |
end |
This file contains 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
describe 10 do | |
it {should be_less_than 11} | |
end |
This file contains 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
specify "5 should be less than 10" do | |
5.should be_less_than 10 | |
end |
This file contains 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
RSpec::Matchers.define :be_less_than do |expected| | |
match do |actual| | |
actual<expected | |
end | |
end |
This file contains 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
it {should have_many(:items).through(:order_items)} | |
it {should have_db_column(:description).of_type(:string)} |
This file contains 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
+ (NSString *)formatTime: (NSTimeInterval)totalSeconds { | |
int totalMinutes = (int) (totalSeconds / 60); | |
int hours = totalMinutes / 60; | |
int minutes = totalMinutes % 60; | |
int seconds = (int) (totalSeconds) % 60; | |
if (hours > 0) { | |
return [NSString stringWithFormat:@"%02i:%02i:%02i", hours, minutes, seconds]; | |
} else { | |
return [NSString stringWithFormat:@"%02i:%02i", minutes, seconds]; |
This file contains 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
// DataManager.h | |
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
extern NSString * const DataManagerDidSaveNotification; | |
extern NSString * const DataManagerDidSaveFailedNotification; | |
@interface DataManager : NSObject { | |
} |